Construct a musical piece that follows the designated lettered structure and integrates the provided motif throughout.
X:1
L:1/8
M:9/8
K:D
['d2 A', 'D2 B A3 B3 c3 Bdc BA^G']  
X:1
L:1/8
M:9/8
K:D
 A | d2 A F2 A D2 A | d2 A F2 A GFE | d2 A F2 A F2 A | ABA GFE D2 A | d2 A F2 A DE/F/A | 
 d2 A FAA GG/F/E | d2 A FAA FAA | A>BA G2 E D2 || B | A3 B3 c3 | Bdc BA^G A3 | d3 e3 f3 | 
 egf e>dc d2 B | A^GA B^AB c2 =A | B/c/dc BA^G A2 A | dAd e^de f2 =d | e/f/gf eac d2 ||  