#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cerr.tie(nullptr);
  long long n, sol = 0, x, m;
  cin >> n;
  for (int i = 0; i < 63; ++i) {
    x = 1;
    m = ((1LL << i) - 1) * 2 - 1;
    while (x + m < n * 2 / x) x += 10240;
    while (x > 1e3 && x + m > n * 2 / x) x -= 1024;
    while (x * (x + m) < n * 2) x += 2;
    if (x * (x + m) == n * 2) {
      sol = x * (1LL << i);
      cout << sol << "\n";
    }
  }
  if (!sol) cout << -1;
}
