#include <bits/stdc++.h>
unsigned long long mulmod(unsigned long long a, unsigned long long b,
                          unsigned long long m) {
  unsigned long long res = 0;
  while (a) {
    if (a & 1) {
      if (b >= m - res) res -= m;
      res += b;
    }
    a >>= 1;
    unsigned long long tb = b;
    if (b >= m - b) tb -= m;
    b += tb;
  }
  return res;
}
unsigned long long modpow(unsigned long long a, unsigned long long b,
                          unsigned long long n) {
  unsigned long long result = 1;
  while (b > 0) {
    if (b % 2) result = mulmod(result % n, a % n, n);
    b >>= 1;
    a = mulmod(a % n, a % n, n);
  }
  return result;
}
bool mr(unsigned long long n) {
  const unsigned long long base[7] = {2,      325,     9375,      28178,
                                      450775, 9780504, 1795265022};
  if (n == 0) return false;
  if (n <= 3) return true;
  unsigned long long d = n - 1;
  int s = 0;
  while (d % 2 == 0) s++, d >>= 1;
  for (int i = 0; i < 7; i++) {
    if (base[i] % n == 0) continue;
    unsigned long long a = base[i];
    if (modpow(a, d, n) == 1) continue;
    bool found = false;
    for (int r = 0; r < s && !found; r++) {
      if (modpow(a, (1ull << r) * d, n) == n - 1) found = true;
    }
    if (!found) return false;
  }
  return true;
}
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  return !b ? a : gcd(b, a % b);
}
unsigned long long prho(unsigned long long n) {
  int i = 0, k = 2;
  unsigned long long x = 3, y = 3;
  if (mr(n)) return n;
  if (n < 50000) {
    for (int i = 2; i < 50000; i++) {
      if (n % i == 0) return i;
    }
  }
  while (true) {
    i++;
    x = (mulmod(x, x, n) + n - 1) % n;
    unsigned long long delta;
    if (x > y)
      delta = x - y;
    else
      delta = y - x;
    unsigned long long d = gcd(delta, n);
    if (d != 1 && d != n) return d;
    if (i == k) y = x, k *= 2;
  }
}
int64_t bs(int64_t a, int64_t b, int64_t t) {
  if (a > b) a = b;
  if (b < a) b = a;
  if (a == b) {
    if (a * (a - 1) == t) return a;
    return -1;
  }
  int64_t c = (a + b + 1) / 2;
  int64_t v = c * (c - 1);
  if (v > t) return bs(a, c - 1, t);
  if (v < t)
    return bs(c + 1, b, t);
  else
    return c;
}
void factor(int64_t N, std::map<int64_t, int> &pf) {
  uint64_t fac = prho(N);
  if (fac == N) {
    pf[N]++;
    return;
  } else
    factor(fac, pf), factor(N / fac, pf);
}
int64_t N;
std::set<int64_t> results;
void try_factors(std::map<int64_t, int>::iterator &i,
                 const std::map<int64_t, int>::iterator &end, int64_t acc) {
  if (end == i) {
    int64_t nn = N;
    nn /= acc;
    if ((acc - 1) % 2 != 0) return;
    nn -= (acc - 1) / 2;
    nn++;
    if (__builtin_popcountll(nn) != 1) return;
    int64_t y = __builtin_ctz(nn);
    results.insert(acc * nn);
    return;
  }
  uint64_t pacc = 1;
  int max = i->second;
  uint64_t p = i->first;
  ++i;
  for (int j = 0; j <= max; j++) {
    try_factors(i, end, acc * pacc);
    pacc *= p;
  }
  --i;
}
int main() {
  std::cin >> N;
  std::map<int64_t, int> pf;
  factor(N, pf);
  auto it = pf.begin();
  try_factors(it, pf.end(), 1);
  if (results.size() == 0) {
    std::cout << -1 << std::endl;
    return 0;
  }
  for (auto i : results) std::cout << i << std::endl;
  return 0;
}
