Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/8
M:2/4
K:D
['AAAA BBBB cdec', 'D2 ffff ee e2 dddd cc c2'  
X:1
L:1/8
M:2/4
K:D
 AAAA | BBBB | cdec | dAFD | AAAA | BBBB | cdec | d2 D2 :: ffff | ee e2 | dddd | cc c2 | BBBB | 
 AAAg | fedc | d2 D2 :|  