Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/8
M:2/4
K:G
['AGA _B2 A2 (3GAB A3']  
X:1
L:1/8
M:2/4
K:G
 AGA | _B2 A2 (3GAB | A3 AGA | _B2 A2 (3GAB | A3 GGG | d2 d2 _ed | c_BAB | c_BdcBA | G3 |]  