Rectangle Partitioning
There is a rectangle with its sides aligned to the coordinate axes. One vertex of this rectangle is at (0, 0), and the opposite vertex is at (M, N). This rectangle is divided into K smaller rectangles, all with sides parallel to the coordinate axes. These smaller rectangles do not overlap internally, and together they completely fill the original rectangle.
The positions of K−1 of these rectangles are known, and your task is to determine the position of the remaining rectangle.
Input
The input begins with a line containing three integers: the first two integers specify the coordinates of the opposite vertex of the original rectangle (M and N), and the third integer is the total number of rectangles K (1 ≤ K ≤ 10^5). The following K−1 lines each contain four integers x_1, y_1, x_2, y_2, where (x_1, y_1) and (x_2, y_2) are the coordinates of two diagonally opposite vertices of one of the known rectangles. All coordinates are integers and do not exceed 10^9 in absolute value. Each line's numbers are separated by spaces.
Output
The output should be the coordinates of the two diagonally opposite vertices of the missing rectangle, formatted in the same way.