Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/8
M:2/2
K:D
['(3(ABc) dAFA dfaf gfef d2 A2 BdAd', '(3(ABc) dAFA dfaf gfef dcBA BcdB BGEC', 'D2 (FG) AFdA fdAF GABG E3 f', 'A (3(ded) Ad (3(fgf) df (3(aba) fd'  
X:1
L:1/8
M:2/2
K:D
 (3(ABc) | dAFA dfaf | gfef d2 A2 | BdAd GdFd | FEED E2 (3(ABc) || dAFA dfaf | gfef dcBA | 
 BcdB BGEC | D2 D2 D2 :: (FG) | AFdA fdAF | GABG E3 f | gfed cdef | edcB A3 A || 
 (3(ded) Ad (3(fgf) df | (3(aba) fd A2 f2 | gfed cABc | d2 d2 d2 :|  