Construct a musical work following the provided guidelines and thematic elements.
X:1
L:1/8
Q:1/8=160
M:9/8
K:D
['DBA F2 d A2 f', 'DBA F2 d', 'f DBA F2 d A2 f a2'  
X:1
L:1/8
Q:1/8=160
M:9/8
K:D
"^allegro" DBA F2 d A2 f | DBA F2 d A2 f | a2 g f2 e ^d2 e | gfe dcB AGE |"^5" DBA F2 d A2 f | 
 DBA F2 d A2 f | a2 g ^A2 B f2 e | dcB A2 c d3 :|"^9" e2 c A2 c ea^g | f2 d B2 d A2 d | 
 ^G2 f e2 ^d e2 =d | cdc AF^G A3 |"^13" e2 c A2 c ea^g | f2 d B2 d A2 d | ^G2 f e2 ^d e2 =d | 
 ced cBA GFE ||"^Part A repeat""^1a" DBA F2 d A2 f | DBA F2 d A2 f | a2 g f2 e ^d2 e | 
 gfe dcB AGE |"^5a" DBA F2 d A2 f | DBA F2 d A2 f | a2 g ^A2 B f2 e | dcB A2 c !fermata!d3 |]  