Create a musical piece that includes the provided motif while adhering to the necessary musical structure.
X:1
L:1/8
M:4/4
K:Amix
['EAAG EGDG EA A2 fAeA EAAG EDEF', 'd2 BG'  
X:1
L:1/8
M:4/4
K:Amix
 EAAG EGDG | EA A2 fAeA | EAAG EDEF |1 G2 DG B,GDG :|2 GFGA BcdB || A2 eA fAeA | fAeA dBGB | 
 A2 gA fAeA | d2 BG EFGB | A2 eA fAeA | fAeA dBGB | e3 f g3 e | d2 BG EFGB ||  