#include <bits/stdc++.h>
using namespace std;
using namespace std;
const int MAXP = 2000;
int primes[MAXP + 1], pN;
bool isPrime[MAXP + 1];
pair<unsigned long long, int> factors[69];
int fN;
void preprocess() {
  int i, j;
  memset(isPrime, true, sizeof(isPrime));
  isPrime[0] = isPrime[1] = false;
  for (i = 2; i <= MAXP; ++i)
    if (isPrime[i]) {
      primes[pN++] = i;
      for (j = i + i; j <= MAXP; j += i) isPrime[j] = false;
    }
}
unsigned long long modMul(unsigned long long a, unsigned long long b,
                          unsigned long long n) {
  unsigned long long p = 8, len = 61, dig, back = 0, temp = a % n;
  for (; p < n; len -= 4, p <<= 4)
    ;
  dig = ((unsigned long long)1 << len) - 1;
  for (; b > 0; b >>= len) {
    if (b & dig) {
      if ((back += temp * (b & dig)) > n) back %= n;
    }
    if ((temp <<= len) > n) temp %= n;
  }
  return back;
}
unsigned long long modExp(unsigned long long a, unsigned long long b,
                          unsigned long long n) {
  unsigned long long z = 1;
  do {
    if (b & 1) z = modMul(z, a, n);
    a = modMul(a, a, n);
  } while (b >>= 1);
  return z;
}
bool millerRabin(unsigned long long n) {
  if (n == 2) return true;
  if (n < 2 || !(n & 1)) return false;
  int j, k = 0;
  unsigned long long m = n - 1, a;
  for (; !(m & 1); m >>= 1, ++k)
    ;
  for (int i = 0; i < 5; ++i) {
    a = modExp((unsigned long long)rand() * rand() * rand() % (n - 1) + 1, m,
               n);
    if (a == 1) continue;
    for (j = 0; j < k; ++j, a = modMul(a, a, n))
      if (a == n - 1) break;
    if (j >= k) return false;
  }
  return true;
}
inline unsigned long long gcd(unsigned long long a, unsigned long long b) {
  unsigned long long t;
  while (b) {
    t = b;
    b = a % b;
    a = t;
  }
  return a;
}
inline unsigned long long f(unsigned long long x, unsigned long long n) {
  unsigned long long xx = modMul(x, x, n) + 1;
  return xx == n ? 0 : xx;
}
unsigned long long brent(unsigned long long n) {
  if (n < 2) return 0;
  if (!(n & 1)) return 2;
  const static int MAXL = 10;
  unsigned long long k, g, x, y, q, r, ys;
  for (int i = 0; i < 10; ++i) {
    y = (unsigned long long)rand() * rand() * rand() % n;
    r = q = 1;
    do {
      x = y;
      for (int j = 0; j < r; ++j) y = f(y, n);
      k = 0;
      do {
        ys = y;
        int a = MAXL > r - k ? r - k : MAXL;
        for (int l = 0; l < a; ++l) {
          y = f(y, n);
          q = modMul(q, (x - y + n) % n, n);
        }
        g = gcd(q, n);
        k += MAXL;
      } while (k < r && g <= 1);
      r += r;
    } while (g <= 1);
    if (g == n) {
      do {
        ys = f(ys, n);
        g = gcd((x - ys + n) % n, n);
      } while (g <= 1);
    }
    if (g != n) return g;
  }
  return 0;
}
void getFactors(unsigned long long n) {
  int i, c;
  fN = 0;
  for (i = 0; i < pN && primes[i] * primes[i] <= n; ++i)
    if (n % primes[i] == 0) {
      c = 0;
      while (n % primes[i] == 0) {
        n /= primes[i];
        ++c;
      }
      factors[fN++] = make_pair((unsigned long long)primes[i], c);
    }
  while (n > 1) {
    unsigned long long p = n;
    while (!millerRabin(p)) p = brent(p);
    c = 0;
    while (n % p == 0) {
      n /= p;
      ++c;
    }
    factors[fN++] = make_pair(p, c);
  }
  sort(factors, factors + fN);
}
vector<unsigned long long> ans;
void dfs(int depth, unsigned long long value, unsigned long long n) {
  if (depth >= fN) {
    unsigned long long v = value;
    if (v > 2000000000 || n < v * (v - 1) / 2) {
      return;
    } else if ((n - v * (v - 1) / 2) % v != 0) {
      return;
    } else {
      unsigned long long t = (n - v * (v - 1) / 2) / v;
      if ((t & (t + 1)) == 0) {
        ans.push_back(v * (t + 1));
      }
    }
  } else {
    unsigned long long k = 1;
    for (int i = 0; i <= factors[depth].second; ++i) {
      dfs(depth + 1, value * k, n);
      k *= factors[depth].first;
    }
  }
}
int main() {
  preprocess();
  unsigned long long n;
  cin >> n;
  if (millerRabin(n)) {
    factors[fN++] = make_pair(n, 1);
  } else {
    getFactors(n);
  }
  dfs(0, 1, n);
  if (ans.size() == 0) {
    cout << -1 << endl;
  } else {
    sort(ans.begin(), ans.end());
    for (int i = 0; i < ans.size(); ++i) {
      cout << ans[i] << endl;
    }
  }
  return 0;
}
