Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/8
M:4/4
K:D
['', 'ag f2 ef d2 AF AdAF Agfe', 'fgfe dcde faaf gafg eAce dgfe faa^g', 'DF F2'  
X:1
L:1/8
M:4/4
K:D
 ag |: f2 ef d2 AF | AdAF Agfe | dAAF DF F2 | ABdf egfe | dAAF dAAF | BAFA dADE | EDFA defa |1 
 afef dfag :|2 afef d2 (3ABc |: dgfe faaf | g3 e fgfe | dcde faaf | gafg eAce | dgfe faa^g | 
 a3 f efdB | ADFA defa | afef d2 (3ABc :: dAAF BAAF | D3 F AF F2 | dFAF dF F2 | ABdf egfe | 
 d2 AF DF F2 | AdFA DF F2 | ABde fa^gb |1 afef d2 (3ABc :|2 afef dfag ||  