Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/8
M:2/2
K:D
['D2 (3(FED)', 'E2 dcdB ADFB ADFB ADFA dcdB ADFA'  
X:1
L:1/8
M:2/2
K:D
 uA,2S | D2 (3(FED) AGFE | Dddc defd | D2 (3(FED) ADFA | (3(Bcd) (AF) FEEF | D2 (3(FED) AGFE | 
 Dddc defg | gfge fdcA | (3(Bcd) (AF) (FE) E2 |] dcdB ADFB | ADFB ADFA | dcdB ADFA | 
 (3(Bcd) (AF) FEEc | dCcD BDAD | BAFA Bcde | (3(fgf) (3(efe) dcBA | (3(GFE) (3(FED) B,DCE |]  