#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i = 0;
  cin >> n;
  vector<int> arr;
  arr.push_back(1);
  n--;
  while (1) {
    if (arr[i] == arr[i - 1]) {
      arr.erase(arr.begin() + i);
      arr[i - 1]++;
      i--;
      continue;
    }
    arr.push_back(1);
    i++;
    if (n == 0) break;
    n--;
  }
  for (int i = 0; i < (int)arr.size() - 1; i++) cout << arr[i] << " ";
  cout << endl;
}
