Construct melodies utilizing the provided motif and adhere to the outlined musical structure.
X:1
L:1/8
M:12/8
K:D
['FGA d2 d', 'a2 a f2 e d3 def'  
X:1
L:1/8
M:12/8
K:D
|: FGA d2 d FGA d2 d | e2 A cBA e2 A cBA | FGA d2 d FGA d2 d | e2 A cBA B2 c d3 :: 
 a2 a f2 e d3 def | g2 e f2 d e3 efg | a2 a f2 e d3 def | e2 A cBA B2 c d3 :|  