#include <bits/stdc++.h>
using namespace std;
bool SortbySecDesc(const pair<long long, long long> &a,
                   const pair<long long, long long> &b) {
  return a.second > b.second;
}
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  ;
  long long n;
  cin >> n;
  stack<int> s;
  vector<int> v;
  v.push_back(1);
  for (int i = 2; i <= n; i++) {
    v.push_back(1);
    for (int j = v.size() - 1; j >= 1; j--) {
      int len = v.size();
      if (v[j] == v[j - 1] && v[j] != 0 && v[j - 1] != 0) {
        v[j - 1] += 1;
        v.erase(v.begin() + j);
      }
    }
  }
  for (int i = 0; i < v.size(); i++) {
    if (v[i] != 0) {
      cout << v[i] << " ";
    }
  }
  return 0;
}
