#include <bits/stdc++.h>   using namespace std;   int i, ans, f;   long long n, l, r, mid, x;   long long check(long long mid) {     if ((mid - 1) / 2 > n / mid) return n + 1;     return mid * ((1ll << i) - 1) + mid * (mid - 1) / 2;   }   int main() {     scanf( %I64d , &n);     x = (int)(sqrt(n * 2) + 1e-11);     if (x * (x + 1) == n * 2 && (x + 1) & 1) printf( %I64d n , x + 1), f = 1;     for (i = 1; (1ll << i) - 1 <= n; ++i) {       l = 1;       r = n / ((1ll << i) - 1);       while (l <= r) {         mid = (l + r) / 2;         if (check(mid) <= n)           l = mid + 1;         else           r = mid - 1;       }       if ((l - 1) & 1 && check(l - 1) == n)         printf( %I64d n , (l - 1) * 1 << i), f = 1;     }     if (!f) printf( -1 n );   }   