Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/8
M:4/4
K:C
['B2 (MBA) (Bc) d2', '(3def g2 (Mge) f2 (fd) edef edBd'  
X:1
L:1/8
M:4/4
K:C
 |[M:2/2][K:G] (3:2:2(MBA) | GEDE G2 (GA) | B2 (MBA) (Bc) d2 | GEDE G2 (GB) | AGAB AGEF | 
 (MGE)(DE) G2 GA | B2 (MBA) (Bc) d2 | edef gedc | BGAF G2 || (3def | g2 (Mge) f2 (fd) | edef edBd | 
 (Mge)dB G2 B2 | (MAG)AB AG E2 | (MGE)DE G2 GA | B2 (MBA) (Bc) d2 | edef gedc | BGAF G2 |]  