Finding the value of x and y