All the angles around a point on one side of a line add up to 180°. 
A). Look at the angles at point-D, above the line.
 You've got 40° and you've got a right angle ... 90°.
 Those two angles add up to (40° + 90°) = 130°. 
 How much more is needed to make 180° ?
 (180° - 130°) = 50°. That's angle 'x'.
B). Look at the angles at point-C, below the line.
 You've got 55°.
 How much more is needed to make 180° ?
 (180° - 55°) = 125°. That's angle 'y'.