#include <bits/stdc++.h>
using namespace std;
int main() {
  ifstream fi("input.txt");
  int n, ans = 0, r = 1;
  cin >> n;
  vector<int> a(n);
  a[0] = 1;
  for (int i = 1; i < n; i++) {
    a[r] = 1;
    if (a[r] == a[r - 1]) {
      a[r - 1] += 1;
      a[r] = 0;
    } else
      r++;
    if (r > 1) {
      while (a[r - 1] == a[r - 2]) {
        a[r - 2] += 1;
        a[r - 1] = 0;
        r--;
        if (r == 1) break;
      }
    }
  }
  for (int i = 0; i < r; i++) cout << a[i] << " ";
}
