1,4-pentadiene reacts with excess of HCI in the presence of benzoyl peroxide to give compound X, which upon reaction with excess of Mg in dry ether forms X Compound Y on treatment with ethyl acetate followed by dilute acid yields Z. Identify the structures of compounds X, Y and Z.