#include <bits/stdc++.h>
using namespace std;
int secTL(deque<int> q) {
  int temp = q.back();
  q.pop_back();
  int ret = q.back();
  q.push_back(temp);
  return ret;
}
int main() {
  int n;
  cin >> n;
  deque<int> q;
  for (int i = 0; i < n; i++) {
    q.push_back(1);
    while (q.size() > 1 && q.back() == secTL(q)) {
      q.pop_back();
      q.back()++;
    }
  }
  for (auto it : q) {
    cout << (it) << " ";
  }
  return 0;
}
