Solve x and y for the diagram