Davor's Travel Fund

Find X and K so that 52 weeks of daily deposits, rising by K each day from Monday, total exactly N, maximizing X first and minimizing K.

Easy3Brute forceMathImplementationNo attempts yetTime limit1sMemory limit64 MB

Problem

Davor has conquered the South Pole and is preparing for his next challenge, an Arctic expedition through Siberia, Greenland and Norway. He leaves on 31 December 2018, and he must have saved NN kuna (the Croatian currency) by that day.

Every Monday Davor puts XX kuna (X100X \le 100) into the travel fund, every Tuesday X+KX + K kuna, every Wednesday X+2KX + 2K kuna, and so on, adding KK more each day until Sunday, when he puts in X+6KX + 6K kuna. The saving runs for 52 weeks, from Monday 1 January 2018 to Sunday 30 December 2018.

Given the amount NN, print values XX and KK that collect exactly NN kuna over that period. A solution always exists. If several exist, print the one with the greatest XX and the smallest KK.

Input

The first line contains the integer NN (1456N1456001456 \le N \le 145600).

Output

Print XX on the first line and KK on the second line. Here 0<X1000 < X \le 100 and K>0K > 0.