Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/16
M:2/4
K:A
['Bdef =g2dg Bgdg', 'a2ea caBf'  
X:1
L:1/16
M:2/4
K:A
 vA2ed Bdef | =g2dg Bgdg | A2ed Bdef | =g2{a}gf gedB | A2ed Bdef | =g2dg Bgdg | Afed Bdef | 
 gdBd cAA2 :: a2ea caBf | =g2dg B=gc^g | a2ea caBf | =gdBd cAA^g | a2ea AaBf | =g2dg Bge^g | 
 agef =gaba | gedB BAAa :|  