Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/8
Q:1/8=160
M:6/8
K:D
['d2 f f3 e2 g g3', 'ABA F2 G A2'  
X:1
L:1/8
Q:1/8=160
M:6/8
K:D
 d2 f f3 | e2 g g3 | f2 d dcd | ecA A3 | d2 f f3 | e2 g g3 | fed cBc | d3 D3 :| ABA F2 G | 
 A2 d d3 | ABA FGA | BGE E3 | ABA F2 G | A2 a a2 g | fed edc | d3 D3 :|  