Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/8
M:2/2
K:G
['(DE)FD G2', 'G2 (3(def) (gf)ga (gb)ag (fe)fg (fa)gf (ed)ef'  
X:1
L:1/8
M:2/2
K:G
 (3(uBcd) | (DE)FD G2 GA | (BA)Bd (cB)AG | (FG)EF (DE)FG | (AF)dF E2 EG | (DE)FD G2 GB | 
 (cB)cd (ef)ge | (dc)BA (GF)GA | B2 G2 G2 :: (3(def) | (gf)ga (gb)ag | (fe)fg (fa)gf | 
 (ed)ef (gf)ed | B2 e2 e2 (gB) | (cB)AG (Bd)cB | (cB)cd (ef)ge | (dc)BA (GF)GA | B2 G2 G2 :|  