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:Dmin
['ABAG FGAB cdcA BdcB ABAG FGAg fde^c', 'd2 defg'  
X:1
L:1/8
M:4/4
K:Dmin
"^reel" ABAG FGAB | cdcA BdcB | ABAG FGAg | fde^c Ad d2 :| defg afge | fdcA FGAc | defg afge | 
 fde^c Ad d2 | defg a2 ge | (3fga ge f2 df | afge abag | fde^c Ad d2 |]  