Create a composition based on the provided motif while adhering to the necessary musical structure.
X:1
L:1/8
Q:1/8=140
M:4/4
K:D
['d2 dA FDFA', 'dc BABc dcdB AFGA'  
X:1
L:1/8
Q:1/8=140
M:4/4
K:D
 (3ABc | d2 dA FDFA | BGBd cABc | dcde fcdB | ABcd egfe | d2 dA FDFA | GBGd cedB | Acdf Acec | 
 d2 f2 d2 :| dc | BABc dcdB | AFGA Bcde | feec dccB | ceed e2 dc | BABc dcdB | AFGA BcdB | 
 Acdf Acec |1 d2 f2 d2 :|2"^last time" d2 f2 d2- | d8 |]  