When were fireworks invented?

9th century

**********