#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:100000000")
int ri() {
  int x;
  scanf("%d", &x);
  return x;
}
int mas[100100];
int main() {
  int n;
  scanf("%d", &n);
  int cnt = 1;
  mas[0] = 1;
  for (int i = 1; i < n; i++) {
    mas[cnt++] = 1;
    while (cnt >= 2 && mas[cnt - 1] == mas[cnt - 2]) {
      mas[cnt - 2]++;
      cnt--;
    }
  }
  for (int i = 0; i < cnt; i++) printf("%d ", mas[i]);
  return 0;
}
