Construct a musical piece that integrates the provided motif and corresponds to the indicated musical structure.
X:1
L:1/8
M:4/4
K:G
['G2 g2 g3 f efge d3', 'A2 F2'  
X:1
L:1/8
M:4/4
K:G
 G2 g2 g3 f | efge d3 B | cdec dBAG | ABAG E2 D2 | G2 g2 g3 f | efge d3 c | BcdB cBAB | cdef g4 :| 
[K:D] f2 d2 A2 F2 | GAGF E4 | g2 e2 c2 A2 | F2 FE FE D2 | f2 d2 A2 F2 | GAGF E2 GF | E2 AG FBAc | 
 d4 d4 :|  