Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/8
M:2/2
K:D
['B2 dABF A/A/A AB dABF E/E/E Ee', 'D2 g fdaf fgfe fdaf B/B/B Bg'  
X:1
L:1/8
M:2/2
K:D
 B2 | dABF A/A/A AB | dABF E/E/E Ee | dABF Agfe | dBAF D/D/D D2 :: g | fdaf fgfe | fdaf B/B/B Bg | 
 fdafegfe | dBAF D/D/D D2 :|  