Compound X is Fe2O3.
The involved reaction is a thermite reaction which is also called as aluminothermy.
Fe2O3(s) + 2Al(s) → Al2O3(s) + 2Fe(s) + Heat
Ferric oxide + Aluminium → Aluminium + Iron Oxide.
The thermite reaction is an exothermic reaction between the metal and metal oxide. For example the reaction between the aluminium with the metal oxides, where aluminium acts as a reducing agent. The aluminium reduces the metal oxide most probably an iron (lll) oxide to produce ferrous and aluminium oxide. During the reaction, large amount of energy is released.
Fe2O3 + 2Al → 2Fe + Al2O3 + heat