#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  stack<long long> s;
  for (long long i = 0; i < n; i++) {
    if ((s.empty()) || ((s.top()) != 1)) {
      s.push(1);
    } else {
      long long cur = 1;
      while (!s.empty()) {
        long long t = s.top();
        s.pop();
        if (t != cur) {
          s.push(t);
          s.push(cur);
          break;
        } else {
          cur = t + 1;
        }
      }
      if (s.empty()) s.push(cur);
    }
  }
  vector<long long> v;
  while (!(s.empty())) {
    long long c = s.top();
    s.pop();
    v.push_back(c);
  }
  for (long long i = v.size() - 1; i > 0; i--) {
    cout << v[i] << " ";
  }
  cout << v[0];
  return 0;
}
