Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/8
M:4/4
K:Dmin
['D2 E>F E>A F<D', '=B^f^c d2 f>e d<A A>d e2 g>f'  
X:1
L:1/8
M:4/4
K:Dmin
 A^c | d2 A>G F<D D2 | E>F E>A F<D DA | B>A G>B A>F D>F | E>F E>D C/E/A A^c | d2 A>G F<D D2 | 
 E>F E>A F<D DA | B>A G>B A<d D2 | E>F E>A F<D (3A=B^c | | =B^f^c |: d2 f>e d<A A>d | 
 e2 g>f e<A A2 | f2 a>f B2 g2 | (3fed (3cde f<d (3A=B^c :|  