Three liquids X, Y and Z containing only hydrogen and carbon were burnt on a…