Fence

Given points on grid corners, find the shortest closed fence along cell edges and diagonals that encloses all of them, output as a + b*sqrt(2).

Hard8GeometrySortingImplementationNo attempts yetTime limit2sMemory limit512 MB

Problem

M-O is a small robot that cleans the floor of the Axiom, a starliner built by the Buy n Large corporation. Tonight the great hall of the Axiom is a mess. Foreign microbes have spread over its floor, and wiping all of them is M-O's job.

The floor of the great hall is an infinite grid of 1×11 \times 1 cells. The four edges and the two diagonals of every cell are drawn as white segments. Every microbe sits on a corner of a cell.

Cleaning takes a long time, so M-O first builds a fence around the microbes to stop them from spreading to other areas of the ship. M-O places the fence only on white segments, that is, on cell edges and cell diagonals. The fence is a single closed path, and every microbe must lie inside the fence or on the fence itself.

Given the positions of the microbes, find the perimeter of a shortest fence.

Input

The input holds several test cases. Each test case starts with a line holding the number of microbes in the great hall, nn (1n100001 \le n \le 10000). Each of the next nn lines holds two integers xix_i and yiy_i, the coordinates of the ii-th microbe. The absolute value of every coordinate is at most 10610^6. The origin is an arbitrary cell corner. Two microbes are allowed to sit on the same corner.

The last line of the input holds a single 00. That line is not a test case.

Output

The perimeter of any fence laid on grid edges and grid diagonals can be written uniquely as a+b2a + b\sqrt{2}, where aa and bb are non-negative integers. For each test case, write the two integers aa and bb on one line, separated by a space, where a+b2a + b\sqrt{2} is the perimeter of a shortest fence.

The fence is a closed path. If two parts of the fence overlap, the overlapping part counts twice.