Two best friends Serozha and Gena play a game.

Initially there is one pile consisting of *n* stones on the table. During one move one pile should be taken and divided into an arbitrary number of piles consisting of *a*<sub class="lower-index">1</sub> &gt; *a*<sub class="lower-index">2</sub> &gt; ... &gt; *a*<sub class="lower-index">*k*</sub> &gt; 0 stones. The piles should meet the condition *a*<sub class="lower-index">1</sub> - *a*<sub class="lower-index">2</sub> = *a*<sub class="lower-index">2</sub> - *a*<sub class="lower-index">3</sub> = ... = *a*<sub class="lower-index">*k* - 1</sub> - *a*<sub class="lower-index">*k*</sub> = 1. Naturally, the number of piles *k* should be no less than two.

The friends play in turns. The player who cannot make a move loses. Serozha makes the first move. Who will win if both players play in the optimal way?
The single line contains a single integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>).
none
from math import sqrt
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())
abc="abcdefghijklmnopqrstuvwxyz"
t=ii()
i=2
f=0
while(1):
    s=t-(i*(i-1))//2
    if(s<=0):
        f=1
        break
    if(s%i==0 and i%2==0):
        break
    i+=1
if(f==1):
    print("-1")
else:
    print(i)