Compose melodies adhering to the given motif and the outlined musical structure.
X:1
L:1/8
M:4/4
K:D
['D2 d2 DFED E2 e2 EGFE', 'fdec a2 A2 BAGB A2 a2 gfeg'  
X:1
L:1/8
M:4/4
K:D
 D2 d2 DFED | E2 e2 EGFE | FGAB cdef | gefd ecBA | D2 d2 DFED | E2 e2 EGFE | FAdf Bgfe | fdec :: 
 a2 A2 BAGB | A2 a2 gfeg | fgaf efge | fdef ecBA | D2 d2 DFED | E2 e2 EGFE | FAdf Bgfe | feec :|  