#include <bits/stdc++.h>
using namespace std;
int a[100010];
int main(void) {
  int n;
  cin >> n;
  int l = -1;
  for (int i = 0; i < n; i++) {
    l++;
    a[l] = 1;
    while (l >= 1 && a[l] == a[l - 1]) {
      a[l - 1] += 1;
      l--;
    }
  }
  for (int i = 0; i <= l; i++) {
    cout << a[i] << ' ';
  }
  return 0;
}
