Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/8
M:4/4
K:G
['A>(B c>)(Bc>)(A', '(D2 B,>)(DG>)(A B>)(AG>)(F E>)(CE>)(G c>)(BA>)(G'  
X:1
L:1/8
M:4/4
K:G
 (d2 | g>)fg>(d B>c)d>(B | e>)(de>)(c A2) A>(B | c>)(Bc>)(A F>)GA>(F | G>)(AB>)c d2 d2 | 
 g>(fg>)(d B>)(cd>)(B | e>)(de>)c A2 A>(B | c>)(Bc>)(A F>)(GA>)(F | G2) B2 G2 :: (D2 | 
 B,>)(DG>)(A B>)(AG>)(F | E>)(CE>)(G c>)(BA>)(G | F>)(DF>)(A d>)(Bc>)(A | B>)(FG>)(E D2) (D2 | 
 B,>)(DG>)(A B>)(AG>)(F | E>)(CE>)(G c>)(BA>)(G | F>)(GA>)(B c>)(de>)(f | g2) g2 g2 :|  