eolymp
bolt
Try our new interface for solving problems
Problems

Inverted Tower

Inverted Tower

The Babylonians decided to build an amazing tower - expanding to the top and containing an infinite number of floors and rooms. It is arranged as follows - on the first floor there is one room, then there are two floors each with two rooms, then there are three floors, each with three rooms and so on.

prb8373.gif

This tower was decided to equip with an elevator - and here is the problem: given room number you need to determine the floor and position of the room on that floor from the left.

Input

Room number n (1n2 * 109).

Output

Print two space separated integers: the floor and the position of the room on that floor from the left.

Time limit 1 second
Memory limit 128 MiB
Input example #1
1
Output example #1
1 1
Input example #2
5
Output example #2
3 2