Construct a musical piece that integrates the provided motif and corresponds to the indicated musical structure.
X:1
L:1/4
Q:1/4=120
M:4/4
K:D
['d2 e2 f d', 'F A'  
X:1
L:1/4
Q:1/4=120
M:4/4
K:D
"^A" z | d2 e2 | f d d2 | B c e c | B A A2 | d2 e2 | f d e2 | B c e c | d3 |:"^B" A | F A A G | 
 F A A G | F A d e | e3 :|  