#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
int n, a[maxn];
int main() {
  scanf("%d", &n);
  int cur = 0;
  a[0] = 1;
  for (int i = 1; i < n; ++i) {
    a[++cur] = 1;
    while (cur != 0 && a[cur] == a[cur - 1]) {
      a[cur - 1]++;
      --cur;
    }
  }
  for (int i = 0; i <= cur; ++i) {
    if (i) printf(" ");
    printf("%d", a[i]);
  }
}
