#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  stack<long long> S;
  int n;
  cin >> n;
  vector<long long> V;
  V.push_back(1);
  n--;
  while (n--) {
    V.push_back(1);
    int i = V.size() - 1;
    while (V.size() > 1 && V[i] == V[i - 1]) {
      long long Val = V[i] + 1;
      V.pop_back();
      V.pop_back();
      V.push_back(Val);
      i = V.size() - 1;
    }
  }
  for (int i = 0; i < V.size(); i++) {
    cout << V[i] << " ";
  }
  return 0;
}
