#include <bits/stdc++.h>
using namespace std;
int main() {
  long long p;
  while (scanf("%lld", &p) == 1) {
    vector<long long> res;
    for (long long b = -1, s = 2, i = 0; i < 60; b += s, s *= 2, i++) {
      long double d = (long double)b * b + 8.0 * p;
      long long sq = round(sqrt(d));
      long long x = (-b + sq) / 2;
      if (x > 0) res.push_back(x * (s / 2));
      if (x > 1) res.push_back((x - 1) * (s / 2));
      if (x > -1) res.push_back((x + 1) * (s / 2));
    }
    sort(res.begin(), res.end());
    res.resize(unique(res.begin(), res.end()) - res.begin());
    bool ok = 0;
    for (int i = 0; i < res.size(); i++) {
      long long acc = 0, x;
      for (x = res[i]; x % 2 == 0; x /= 2) acc += x / 2;
      if (acc + (x * (x - 1)) / 2 == p) {
        ok = 1;
        printf("%lld\n", res[i]);
      }
    }
    if (!ok) printf("-1\n");
  }
  return 0;
}
