Problem: Daniel is organizing a football tournament. He has come up with the following tournament format: 

  1. In the first several (possibly zero) stages, while the number of teams is even, they split in pairs and play one game for each pair. At each stage the loser of each pair is eliminated (there are no draws). Such stages are held while the number of teams is even. 
  2. Eventually there will be an odd number of teams remaining. If there is one team remaining, it will be declared the winner, and the tournament ends. Otherwise each of the remaining teams will play with each other remaining team once in round robin tournament (if there are x teams, there will be <image> games), and the tournament ends. 



For example, if there were 20 teams initially, they would begin by playing 10 games. So, 10 teams would be eliminated, and the remaining 10 would play 5 games. Then the remaining 5 teams would play 10 games in a round robin tournament. In total there would be 10+5+10=25 games.

Daniel has already booked the stadium for n games. Help him to determine how many teams he should invite so that the tournament needs exactly n games. You should print all possible numbers of teams that will yield exactly n games in ascending order, or -1 if there are no such numbers.

Input

The first line contains a single integer n (1 ≤ n ≤ 1018), the number of games that should be played.

Please, do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.

Output

Print all possible numbers of invited teams in ascending order, one per line. If exactly n games cannot be played, output one number: -1.

Examples

Input

3


Output

3
4


Input

25


Output

20


Input

2


Output

-1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::ostream;
using std::reverse;
struct BigNum {
 private:
  int bit[100];
  int size;

 public:
  friend BigNum operator+(const BigNum& bn1, const BigNum& bn2) {
    BigNum res(0);
    res.size = max(bn1.size, bn2.size);
    for (int i = 1; i <= res.size; i++) {
      res.bit[i] += bn1.bit[i] + bn2.bit[i];
      while (res.bit[i] >= 10) {
        res.bit[i + 1] += res.bit[i] / 10;
        res.bit[i] %= 10;
      }
    }
    while (res.bit[res.size + 1]) res.size++;
    return res;
  }
  friend BigNum operator*(const BigNum bn1, const BigNum bn2) {
    BigNum res;
    for (int i = 1; i <= bn1.size; i++) {
      for (int j = 1; j <= bn2.size; j++) {
        res.bit[i + j - 1] += bn1.bit[i] * bn2.bit[j];
        while (res.bit[i + j - 1] >= 10) {
          res.bit[i + j] += res.bit[i + j - 1] / 10;
          res.bit[i + j - 1] %= 10;
        }
      }
    }
    res.size = bn1.size + bn2.size;
    while (!res.bit[res.size]) res.size--;
    return res;
  }
  BigNum inc() {
    BigNum res = *this;
    res.bit[1]++;
    for (int i = 1; i <= res.size; i++) {
      if (res.bit[i] >= 10) {
        res.bit[i + 1] += res.bit[i] / 10;
        res.bit[i] %= 10;
      } else
        break;
    }
    while (res.bit[res.size + 1]) res.size++;
    return res;
  }
  BigNum dec() {
    BigNum res = *this;
    res.bit[1]--;
    for (int i = 1; i <= res.size; i++) {
      if (res.bit[i] < 0) {
        res.bit[i] += 10;
        res.bit[i + 1]--;
      } else
        break;
    }
    while (!res.bit[res.size]) res.size--;
    return res;
  }
  static int max(int a, int b) {
    if (a > b) return a;
    return b;
  }
  BigNum div2() {
    BigNum res(0);
    int yu = 0;
    for (int i = size; i >= 1; i--) {
      res.bit[size - i + 1] = bit[i] + yu * 10;
      yu = res.bit[size - i + 1] % 2;
      res.bit[size - i + 1] /= 2;
    }
    res.size = size;
    reverse(res.bit + 1, res.bit + 1 + res.size);
    while (!res.bit[res.size]) res.size--;
    return res;
  }
  void clear() { memset(bit, 0, sizeof bit); }
  BigNum() : size(0) { clear(); }
  BigNum(long long bn) {
    clear();
    size = 0;
    while (bn) {
      bit[++size] = bn % 10;
      bn /= 10;
    }
  }
  long long toll(BigNum& bn) {
    long long res = 0;
    ;
    for (int i = bn.size; i >= 1; i--) {
      res = (res << 3) + (res << 1) + bn.bit[i];
    }
    return res;
  }
  friend bool operator<=(const BigNum& bn1, const BigNum& bn2) {
    if (bn1.size < bn2.size) return true;
    if (bn1.size > bn2.size) return false;
    for (int i = bn1.size; i >= 1; i--) {
      if (bn1.bit[i] > bn2.bit[i]) return false;
      if (bn1.bit[i] < bn2.bit[i]) return true;
    }
    return true;
  }
  friend int cmpr(const BigNum bn1, const BigNum bn2) {
    if (bn1.size < bn2.size) return -1;
    if (bn1.size > bn2.size) return 1;
    for (int i = bn1.size; i >= 1; i--) {
      if (bn1.bit[i] > bn2.bit[i]) return 1;
      if (bn1.bit[i] < bn2.bit[i]) return -1;
    }
    return 0;
  }
  long long sqrt() {
    BigNum l(1);
    BigNum r = *this;
    BigNum m(0);
    BigNum mm(0);
    while (l <= r) {
      m = (l + r).div2();
      switch (cmpr(m * m, *this)) {
        case 1:
          r = m.dec();
          break;
        case -1:
          l = m.inc();
          break;
        case 0:
          return toll(m);
      }
    }
    return -1;
  }
  void operator=(const BigNum& bn2) {
    clear();
    size = bn2.size;
    for (int i = 1; i <= size; i++) bit[i] = bn2.bit[i];
  }
  friend ostream& operator<<(ostream& os1, const BigNum bn1) {
    for (int i = bn1.size; i >= 1; i--) cout << bn1.bit[i];
    return os1;
  }
};
int main() {
  BigNum b(0);
  BigNum c(0);
  BigNum bs(0);
  BigNum delta(0);
  long long n;
  cin >> n;
  bool ok = false;
  long long tmp = sqrt(8ll * n + 1);
  if (tmp * tmp == 8ll * n + 1) {
    if (!((1 + tmp) & 1) && ((1 + tmp) & 3)) {
      cout << (1 + tmp) / 2 << '\n';
      ok = true;
    }
  }
  c = BigNum(2 * n);
  c = c * BigNum(4);
  for (long long i = 4; (i >> 1) - 1 <= n; i <<= 1) {
    b = BigNum(i - 3);
    b = b * b;
    delta = b + c;
    long long t = delta.sqrt();
    if (t == -1) continue;
    if (((3 - i + t) & 1) || !((3 - i + t) & 3)) continue;
    long long odd = (3 - i + t) / 2;
    cout << BigNum(i / 2) * BigNum(odd) << '\n';
    ok = true;
  }
  if (!ok) cout << -1;
  return 0;
}