Develop melodies adhering to the specified musical structure and using the offered theme.
X:1
L:1/8
M:2/2
K:D
['d2 fd'  
X:1
L:1/8
M:2/2
K:D
"D" d2 fd d2 fd |"G" edBd"A" egfe |"D" d2 fd d2 fd |"G" efdB"A" A2 A2 ::"G" dB B2 gefd | 
"G" ed (3(Bcd)"A" egfe |"G" dB B2 gefd |"G" efdB"A" A2 A2 ::"D" faaf"G" gfed | 
"G" edBd"A" (3(efg) fe |"D" faaf"G" gfed |1"G" efdB"A" A2 A2 :|2"A" edef"G" g2 fe |]  