Construct melodies utilizing the provided motif and adhere to the outlined musical structure.
X:1
L:1/8
M:6/8
K:D
['d2 A e2 A f2 d def', 'f e2 g geg a2 f f2'  
X:1
L:1/8
M:6/8
K:D
|: A | d2 A e2 A | f2 d def | g2 f e2 d | cde ABc | d2 A e2 A | f2 d def | gfe ABc |1 d3 D2 :|2 
 d3 D3 |: f2 a afa | b2 g g2 f | e2 g geg | a2 f f2 A | d2 A e2 A | f2 d def | gfe ABc | d3 D3 :|  