#include <bits/stdc++.h>
using namespace std;
bool f(int x) {
  int t = 1;
  while (t < x) {
    t *= 2;
  }
  return x == t;
}
int main() {
  int x;
  set<int> s;
  while (cin >> x) {
    if (!f(x)) {
      s.insert(x);
    }
  }
  set<int>::iterator it;
  for (it = s.begin(); it != s.end(); ++it) {
    cout << *it << " ";
  }
  return 0;
}
