Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/8
Q:3/8=140
M:9/8
K:G
['gfg edc BAG', 'AAA A2 B'  
X:1
L:1/8
Q:3/8=140
M:9/8
K:G
 gfg edc BAG | gfg efg afd | gfg edc BAG | AAA A2 B d2 B :: AAA A2 B G2 E | AAA A2 B d2 B | 
 AAA A2 B G2 E | dBG GBc d2 B :|  