Design melodies following the assigned musical pattern while integrating the provided thematic element.
X:1
L:1/8
M:2/4
K:D
['a2 a>g fa- ag fd'  
X:1
L:1/8
M:2/4
K:D
|:"D" a2 a>g | fa- ag | fd d/f/e/d/ |"A7" cA- A2 |"D" a2 a>g | fa- ag |"A7" fd ec |"D" d4 :: 
"D" dd"A7" ee |"D" ff"G" g2 |"D" fd- d2 |"A7" cA- AA |"D" dd"A7" ee |"D" ff"G" g2 |"D" fd"A7" ec | 
"D" d4 |]  