Maja is a bee. She lives in a hive of hexagonal honeycombs with thousands of other bees. But Maja has a problem. Her friend Willi told her where she can meet him, but Willi (a male drone) and Maja (a female worker) have different coordinate systems:
Willi's Coordinate System Willi (on right) is less intelligent, and just walks around cells in clockwise order starting from 1 in the middle of the hive.
Maja's system Willi's system
Help Maja to convert Willi's system to hers. Write a program which for a given honeycomb number returns the coordinates in Maja's system.
The input file contains one or more integers each standing on its own line. All honeycomb numbers are less than 100,000.
Output the corresponding Maja coordinates for Willi's numbers, with each coordinate pair on a separate line.
1 2 3 4 5
0 0 0 1 -1 1 -1 0 0 -1