Construct a musical piece that follows the designated lettered structure and integrates the provided motif throughout.
X:1
L:1/8
M:4/4
K:G
['BGAB dedB e2 dB A2', 'gagf e2']  
X:1
L:1/8
M:4/4
K:G
 B>c | d2 d>B e2 AB | dedc BGAB | dedB e2 dB | A2 AB AG B>c | d2 dB e2 AB | d>ed>c BGAB | 
 dedB e2 dB | A2 AB AG || Bd | gagf e2 df | gagf edBd | gagf e2 dB | A2 AB AG Bd | gagf e2 (3def | 
 gagf edBd |{f} ed(gf) e2 dB | A2 AB AG ||  