Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/8
M:4/4
K:Amix
['a e>def g2 fg BGdG BGdBe>def g2', 'eAAe BGdB'  
X:1
L:1/8
M:4/4
K:Amix
 a | e>def g2 fg | BGdG BGdBe>def g2 ea | BGdB AAA :| a | cAec eAAe | BGdB dGGB | AAec eAAe | 
 BGdB AAAa | cAec eAAe | BGdB dGGB | eA c2 eAAe | BGdB AAA ||  