#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> v;
  for (int i = 1; i <= n; ++i) {
    v.push_back(1);
    while (v.size() > 1 && v.back() == v[v.size() - 2]) {
      v.pop_back();
      ++v.back();
    }
  }
  for (int i = 0; i < v.size(); ++i) printf("%d ", v[i]);
  printf("\n");
  return 0;
}
