Compose melodies adhering to the given motif and the outlined musical structure.
X:1
L:1/8
M:4/4
K:D
['(3ABc defg ecAc d2 (3Bcd BGED', 'gefd gabg'  
X:1
L:1/8
M:4/4
K:D
 D2 FA d2 (3ABc | defg ecAc | d2 (3Bcd BGED | CEAG FDEF | DF F2 D2 (3ABc | defg ecAc | 
 d2 (3Bcd BGED |1 CEAG FDEF :|2 CEAG FD D2 |: defd gefd | gabg ecAc | def/e/d gefd | gabg f3 e | 
 defd gefd | gabg ecAc | d2 (3Bcd BGED |1 CEAG FDDc :|2 CEAG FDEF ||  