#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
int n;
vector<int> ans;
int main() {
  cin >> n;
  for (int i = 17; i >= 0; i--) {
    int temp = 1 << (i);
    if (temp <= n) {
      ans.push_back(i + 1);
      n -= temp;
    }
  }
  for (int i = 0; i < ans.size(); i++) {
    if (i) cout << " ";
    cout << ans[i];
  }
  cout << endl;
  return 0;
}
