#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 123;
const int MINN = 1e3 + 123;
const int mod = 1e9 + 7;
const int INF = 1e9 + 1;
long long tol[MAXN];
int main() {
  long long n, cur = 0;
  cin >> n;
  while (n) {
    n--;
    tol[++cur] = 1;
    if (tol[cur] == tol[cur - 1]) {
      tol[cur] = -1;
      tol[cur - 1] = tol[cur - 1] + 1;
      cur--;
      while (tol[cur] == tol[cur - 1]) {
        tol[cur] = -1;
        tol[cur - 1] = tol[cur - 1] + 1;
        cur--;
      }
    }
  }
  for (int i = 1; i <= cur; i++) cout << tol[i] << ' ';
  return 0;
}
