Construct a musical piece that integrates the provided motif and corresponds to the indicated musical structure.
X:1
L:1/8
M:2/4
K:G
['d d e d A2 z2']  
X:1
L:1/8
M:2/4
K:G
 d d e d | A2 z2 | d d e d | A2 z2 | B3/2 B/ B2 | A B A F | d D F E | D3 E | A B A G | E E G E | 
 D4 |]  