#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 505;
const int MAX_M = 2020;
const int MAX_T = 24;
const int INF = 0x3f3f3f3f;
vector<int> state;
void compress() {
  int s = state.size();
  if (s < 2) return;
  while (state.size() > 1 &&
         (state[state.size() - 1] == state[state.size() - 2])) {
    int v = state.back();
    state.pop_back();
    state.pop_back();
    state.push_back(v + 1);
  }
}
int main() {
  int n;
  cin >> n;
  for (__typeof((n)) i = 0; i < (n); i++) {
    state.push_back(1);
    compress();
  }
  for (__typeof(state.begin()) it = state.begin(); it != state.end(); ++it)
    cout << *it << " ";
  return 0;
}
