#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, x;
  vector<int> arr;
  cin >> n;
  arr.push_back(1);
  for (i = 1; i < n; i++) {
    arr.push_back(1);
    while (arr.size() >= 2 && arr[arr.size() - 1] == arr[arr.size() - 2]) {
      x = arr[arr.size() - 1] + 1;
      arr.pop_back();
      arr.pop_back();
      arr.push_back(x);
    }
  }
  for (auto it : arr) cout << it << " ";
  return 0;
}
