Compose melodies adhering to the given motif and the outlined musical structure.
X:1
L:1/8
M:4/4
K:G
['gdBG cedc BGBd cedc', "g2 d2 afdf afc'a bgdg bgd'b afdf"  
X:1
L:1/8
M:4/4
K:G
|: d2 | gdBG cedc | BGBd cedc | Bbgb Acac | Bbgb Aafa | gdBG cedc | BGBd cedc | Bdce dfac' | 
 bagf g2 :: d2 | afdf afc'a | bgdg bgd'b | afdf afc'b | agfe e2 d2 | ecGc ecge | dBGB dBge | 
 dafd dcBA | G2 B2 G2 :|  