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:D
['f2 ed', 'a2 ga fg ef ed cd FA'  
X:1
L:1/8
M:4/4
K:D
 Af fe f2 ed | (3fga de f2 ed | Be ed fd cd | BA A2 BAFG | Af fe f2 ed | (3fga de f2 ed | 
 dB Be dB cd FE ED D2 :| a2 ga fg ef | ed cd FA DA | Be ed fd ed | BA A2 BA FG | a2 ga fg ef | 
 ed cd FA DA GB B A3 Bcd BA |1 Af fe d2 :|2 FE ED D2 ||  