Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/8
M:4/4
K:D
['d2 fd eA A2 BAFA', 'eA A2 BAFA'  
X:1
L:1/8
M:4/4
K:D
 Bc | d2 fd eA A2 | BAFA BAFA | d3 e f2 af | bfaf eB B2 | d2 fd eA A2 | BAFA BAFG | Adde f2 af | 
 edBA d2 :| e | faaf dcde | faaf eA A2 | BAFA d2 fa | baaf e2 fa | bf f2 afec | d2 fd eA A2 | 
 BAFA dfaf | edBA d3 :|  