For the first reaction-
Y --> CH2BrCOOH( It is HVZ reaction or alpha
halogenation of acids)
Z--> CH2CNCOOH (CN replaces Br)
For the second reaction-
X--> C2H4 (elimination takes place)
Y--> BrCH2-CH2Br (bromination of alkene)
Z--> BrCH2-CH2CN (If 1 equivalent KCN is provided)
CNCH2-CH2CN (If 2 equivalents KCN is provided)
A--> BrC2H4COOH or HOOC-C2H4-COOH (depending
upon the product Z)