Since the sum of angles of a triangle is 180 degrees
Since the measures of the 3 angles of the 1st triangle are

Add them and equate the sum by 180 degrees

Add the like terms on the left side

Subtract 87 from both sides

Since the measures of the 3 angles of the other triangles are

Add them and equate the sum by 180 degrees

Add the like terms on the left side

Subtract 126 from both sides

Substitute the value of x in equation (1) to find y

Subtract 54 from both sides

The answers are:
x = 54
y = 39