You are an expert in program synthesis. You are tasked with solving a Syntax-Guided Synthesis (SyGuS) problem. Your goal is to output a function that should produce outputs that satisfy a series of constraints when given specific inputs.

Question:
(set-logic SLIA)

(synth-fun f ((firstname String) (lastname String)) String)

(declare-var firstname String)
(declare-var lastname String)
(constraint (= (f "Nancy" "FreeHafer") "Nancy F."))
(constraint (= (f "Andrew" "Cencici") "Andrew C."))
(constraint (= (f "Jan" "Kotas") "Jan K."))
(constraint (= (f "Mariya" "Sergienko") "Mariya S."))

(check-synth)
Solution:
(define-fun f ((firstname String) (lastname String)) String (str.++ (str.++ (str.++ firstname " ") (str.at lastname 0)) "."))

Question:
(set-logic SLIA)

(synth-fun f ((name String)) String)

(declare-var name String)
(constraint (= (f "Nancy FreeHafer") "FreeHafer"))
(constraint (= (f "Andrew Cencici") "Cencici"))
(constraint (= (f "Jan Kotas") "Kotas"))
(constraint (= (f "Mariya Sergienko") "Sergienko"))

(check-synth)
Solution:
(define-fun f ((name String)) String (str.substr name (+ 1 (str.indexof name " " 0)) (str.len name)))

Question:
(set-logic SLIA)

(synth-fun f ((name String)) String)

(declare-var name String)
(constraint (= (f "Nancy FreeHafer") "Nancy"))
(constraint (= (f "Andrew Cencici") "Andrew"))
(constraint (= (f "Jan Kotas") "Jan"))
(constraint (= (f "Mariya Sergienko") "Mariya"))

(check-synth)
Solution:
(define-fun f ((name String)) String (str.substr name 0 (str.indexof name " " 0)))

Question:
(set-logic SLIA)

(synth-fun f ((name String)) String)

(declare-var name String)
(constraint (= (f "Nancy FreeHafer") "FreeHafer"))
(constraint (= (f "Andrew Cencici") "Cencici"))
(constraint (= (f "Jan Kotas") "Kotas"))
(constraint (= (f "Mariya Sergienko") "Sergienko"))

(check-synth)
Solution:
