#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e12;
const int MAXN = 1e8 + 2, MODM = 1e9 + 7, P = 1e6 + 3, MULT1 = 30, MULT2 = 239,
          LUCKY = 13, ELEVEN = 11, MAXM = 101;
const unsigned long long C = 18446744073709551615;
vector<int> k;
vector<int> w;
long long len = 0;
long long mas[11];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> p;
  p.push_back(1);
  for (int i = 2; i <= n; i++) {
    p.push_back(1);
    bool fl = 1;
    while ((long long)p.size() > 1 && fl) {
      fl = 0;
      if (1) {
        if (p[(long long)p.size() - 1] == p[(long long)p.size() - 2]) {
          p.pop_back();
          int l = p[(long long)p.size() - 1] + 1;
          p.pop_back();
          p.push_back(l);
          fl = 1;
        }
      }
    }
  }
  for (auto i : p) cout << i << " ";
  return 0;
}
