The plane is divided into equal squares, which are filled with numbers from 0 to infinity in the form of a spiral in a clockwise direction:
Given a positive integer N. Required to find two neighbors on the side or corner of the cell, the number of which sum to N.
The first line contains one integer N (1 <= N <= 1000).
Bring two numbers through the gap is minimal neighbors in ascending order, and giving a total N.