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