#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
void vrikodara(long long n = 12) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(n) << fixed;
}
long long lb = 100000;
long long fun(long long x, long long pw, long long n) {
  if (LLONG_MAX / x <= pw) return -1;
  if (LLONG_MAX / x <= x) return -1;
  if (LLONG_MAX - x * pw <= x * x) return -1;
  long long a = x * (pw - 1);
  long long b = x * (x - 1) / 2;
  return a + b;
}
void solve() {
  long long n;
  cin >> n;
  bool f = false;
  map<long long, long long> mp;
  long long pw = 1;
  while (LLONG_MAX / 2 > pw) {
    long long s = 1, e = 1e12;
    while (s <= e && lb > 0) {
      lb--;
      long long x = (s + e) >> 1;
      long long v = fun(x, pw, n);
      if (v == n) {
        if (mp.count(x * pw) || x % 2 == 0) break;
        mp[x * pw] = 1;
        f = true;
        cout << pw * x << '\n';
        break;
      }
      if (v == -1 || v > n) {
        e = x - 1;
      } else
        s = x + 1;
    }
    pw *= 2;
  }
  if (!f) cout << "-1";
}
int32_t main() {
  vrikodara();
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
