#include <bits/stdc++.h>
using namespace std;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const int maxn = 100010;
const double eps = 1e-8;
int a[maxn], sz = 0;
int main() {
  int n;
  scanf("%d", &n);
  a[sz++] = 1;
  n--;
  while (n--) {
    a[sz++] = 1;
    while (sz >= 2 and a[sz - 1] == a[sz - 2]) {
      a[sz - 2]++;
      sz--;
    }
  }
  for (int _ = 0; _ < sz; ++_) printf("%d%c", a[_], _ == sz - 1 ? '\n' : ' ');
  return 0;
}
