#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int MOD = 1e9 + 7;
const int INF = 1e9 + 9;
const int MX = 1e5 + 5;
int n, inp[MX];
int main() {
  cin >> n;
  if (n <= 2) {
    cout << n << endl;
    return 0;
  }
  int pt = 1;
  inp[1] = 2;
  for (int i = 3; i <= n; i++) {
    int cu = 1;
    while (pt >= 1 && cu == inp[pt]) {
      inp[pt] = cu + 1;
      cu = inp[pt];
      pt--;
    }
    if (pt == 0) {
      pt = 1;
      inp[pt] = cu;
    } else {
      pt++;
      inp[pt] = cu;
    }
  }
  for (int i = 1; i <= pt; i++) cout << inp[i] << " ";
  cout << endl;
  return 0;
}
