#include <bits/stdc++.h>
using namespace std;
bool perfectSquare(long double x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
long long modexp(long long n, long long p, long long c) {
  if (p == 0) return 1;
  long long ans = 1;
  if (p % 2) ans = n % c;
  return ((ans) * (modexp((n * n) % c, p / 2, c) % c)) % c;
}
void test_case() {
  long long n;
  cin >> n;
  vector<long long> ans;
  long long c = 1;
  ans.push_back(1);
  long long j = 1;
  for (long long i = (1); i < (n); ++i) {
    ans.push_back(1);
    long long j = ans.size() - 1;
    while (j >= 1 and ans[j] == ans[j - 1]) {
      ans[j - 1] += 1;
      ans.pop_back();
      j--;
    }
  }
  for (long long i = (0); i < (ans.size()); ++i) cout << ans[i] << " ";
  cout << "\n";
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    test_case();
  }
  return 0;
}
