Compose melodies adhering to the given motif and the outlined musical structure.
X:1
L:1/8
M:4/4
K:D
['E3 F', 'fddf efed Bdeg fedf e3 d (3Bcd'  
X:1
L:1/8
M:4/4
K:D
|: E3 F G2 EF | GBAG FDDF | E3 F G3 A |1 (3.B.c.d ed Bded :|2 (3.B.c.d ed BE E2 || e3 d Bdef | 
 geag fddf | efed Bdeg | fedf e3 d | (3Bcd ed Bdef | geag fd d2 | g3 e dged | B2 Ad BE E2 ||  