Compose melodies using the provided motif and adhering to the designated musical form.
X:1
L:1/8
M:4/4
K:D
['(AB) d2 f3 g(fe) d2']  
X:1
L:1/8
M:4/4
K:D
 (AB) d2 | f3 g(fe) d2 | a4 f2 ed | e2 ee e2 d2 | f2 e2 (d2 B2) |[M:4/4] (AB) d2 | f3 g(fe) d2 | 
 a3 a(fe) d2 | (e2 f)g f2 e2 | d4 |]  