#C4996. Optimal Delivery Point

    ID: 48595 Type: Default 1000ms 256MiB

Optimal Delivery Point

Optimal Delivery Point

You are given n delivery points in the 2D plane. The goal is to determine the optimal starting delivery point such that the total travel time to all other points is minimized. The travel time between any two points is given by the Manhattan distance, defined as:

$$ d((x_1, y_1), (x_2, y_2)) = |x_1 - x_2| + |y_1 - y_2| $$

If there are multiple points with the same minimum total distance, choose the point with the smallest row value; if still tied, choose the point with the smallest column value.

Input: The first line contains an integer n representing the number of delivery points. The following n lines each contain two space-separated integers representing the coordinates of a delivery point.

Output: Print two integers that represent the coordinates of the optimal delivery point.

inputFormat

The first line of input contains an integer n (1 ≤ n ≤ 105 typically, but the problem constraints allow any reasonable size based on context). Each of the next n lines contains two space-separated integers x and y, which represent the coordinates of a delivery point.

outputFormat

Output a single line with two space-separated integers representing the coordinates of the optimal delivery point chosen according to the rules described above.

## sample
1
2 3
2 3