Metals on reaction with acids, produce metal salts and hydrogen gas except copper, gold etc.
When sodium reacts with dilute HCl it forms sodium chloride and hydrogen gas. The reaction involved is:
2Na(s) + 2HCl(g)→2NaCl(s) + H2(g)
Moreover, when it reacts with the cold water it will form sodium hydroxide and hydrogen gas. The hydrogen gas formed immediately catches fire because this reaction generates a lot of heat.
2Na(s) + H2O(l) → 2NaOH(aq) +H2(g)
So, X is sodium and Y is hydrogen.