Construct melodies utilizing the provided motif and adhere to the outlined musical structure.
X:1
L:1/8
M:2/2
K:D
['BA (3(Bcd) A2', '(3(Bcd) eg'  
X:1
L:1/8
M:2/2
K:D
 (d/c/) | BA (3(Bcd) A2 (FA) | dBcA BF- F2 | BA (3(Bcd) A2 (Af) | afeg (fd)d :| e | fddAdfag | 
 fddA (3(Bcd) eg | fddA defg | afeg (fd)de | (fd)dA dfag | (fd)dA (3(Bcd) eg | f2 (fd) g2 (fg) | 
 afeg (fd)d |]  