#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long inf = LLONG_MAX;
const long long ninf = LLONG_MIN;
const double eps = 1e-10;
const long long N = 1000005;
const long long LOGN = log2(N);
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> arr;
  int temp = 1;
  arr.push_back(temp);
  while (1) {
    if (temp * 2 > n)
      break;
    else {
      temp = temp * 2;
      arr.push_back(temp);
    }
  }
  int s = arr.size();
  for (int i = 0; i < s; i++) {
    if (n - arr[s - 1 - i] >= 0) {
      n = n - arr[s - i - 1];
      cout << s - i << " ";
    }
  }
  cout << "\n";
  return 0;
}
