#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<int> v;
int main() {
  int n;
  scanf("%d", &n);
  ;
  for (int i = 0; i < n; i++) {
    v.push_back(1);
    while (v.size() > 1 && v[v.size() - 1] == v[v.size() - 2]) {
      int temp = v[v.size() - 2];
      v.pop_back();
      v.pop_back();
      v.push_back(temp + 1);
    }
  }
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
