Design a musical work that abides by the outlined structure and integrates the assigned theme.
X:1
L:1/8
M:4/4
K:D
['A d3 f e3 g', 'G F3'  
X:1
L:1/8
M:4/4
K:D
 A | d3 f e3 g | f3 d c3 A | d3 f e3 g | f2 a4 z A | d3 f e3 g | f3 d c3 A | B2 B c3 A | B2 d4 :| 
 A3 G F3 D | E2 (G6 | A3) G F3 E | D2 d6 | A3 G F3 D | E2 G6 | A3 G F3 E | D2 d6 | d3 f e3 g | 
 f3 d c3 A | d3 f e3 g | f2 a4 z A | d3 f e3 g | f3 d c3 A | (3afd (3ecA | B2 d6 ||  