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