To find the value of X, first, we calculate the sum of the interior angles of the polygon, which is 360 degrees for a quadrilateral.
Then, we subtract the measures of the given angles (51 degrees, 22 degrees, and 162 degrees) from the sum of the interior angles:
X = 360 degrees - (51 degrees + 22 degrees + 162 degrees)
X = 360 degrees - 235 degrees
X = 125 degrees
So, the value of X is 125 degrees.