#include <bits/stdc++.h>
using namespace std;
int getBit(int num, int pos) { return (num >> pos) & 1; }
int setBit(int num, int pos, int val) {
  if (val == 0) {
    return num & (~(1 << pos));
  } else {
    return num | (1 << pos);
  }
}
int main() {
  int arr[100000];
  int st = 1;
  arr[0] = 1;
  int n, i;
  cin >> n;
  for ((i) = 0; (i) < (int)(n - 1); (i)++) {
    arr[st] = 1;
    while (st > 0 && arr[st] == arr[st - 1]) {
      arr[st - 1] += 1;
      st--;
    }
    st++;
  }
  for ((i) = 0; (i) < (int)(st); (i)++) {
    cout << arr[i] << " ";
  }
}
