Construct melodies utilizing the provided motif and adhere to the outlined musical structure.
X:1
L:1/8
M:4/4
K:Gmin
['d2 =e^f g2 B2 B3 B G4']  
X:1
L:1/8
M:4/4
K:Gmin
|: d2 =e^f |"Gm" g2 B2 B3 B |"D" AD^FG"Gm" G4 | GABc"Cm" dece |"D" d6 cB |"Gm" dgbg"F" cgac | 
"Bb" Bdfd"Cm" c6 BA |"Gm" Bdfd"D" cB{B}AG |"Gm" G6 :|  