#include <bits/stdc++.h>
using namespace std;
using namespace std;
int N;
int main(int nargs, char **argv) {
  scanf("%d", &N);
  vector<int> slimes;
  for (int i = 0; i < N; i++) {
    slimes.push_back(1);
    while (slimes.size() >= 2 &&
           slimes[slimes.size() - 1] == slimes[slimes.size() - 2]) {
      slimes[slimes.size() - 2] += 1;
      slimes.erase(slimes.end() - 1);
    }
  }
  for (auto x : slimes) {
    cout << x << " ";
  }
  cout << endl;
  return 0;
}
