#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, i;
  cin >> n;
  stack<int> s;
  for (i = 0; i < n; i++) {
    while ((int)(s.size()) >= 2) {
      int a = s.top();
      s.pop();
      int b = s.top();
      if (a == b)
        s.pop(), s.push(b + 1);
      else {
        s.push(a);
        break;
      }
    }
    s.push(1);
  }
  while ((int)(s.size()) >= 2) {
    int a = s.top();
    s.pop();
    int b = s.top();
    if (a == b)
      s.pop(), s.push(b + 1);
    else {
      s.push(a);
      break;
    }
  }
  vector<int> ans;
  while (!s.empty()) {
    ans.push_back(s.top());
    s.pop();
  }
  int l = (int)(ans.size());
  for (i = l - 1; i >= 0; i--) cout << ans[i] << " ";
  cout << '\n';
  return 0;
}
