#include <bits/stdc++.h>
using namespace std;
long long int a[1000005], po[100];
long long int por(long long int p) {
  long long int i, j;
  i = 1;
  j = 1;
  while (i <= p) {
    i = i * 2;
    j++;
  }
  i = i / 2;
  return i;
}
int main() {
  long long int i, j, k, m, n, p;
  for (i = 0; i <= 18; i++) {
    k = pow(2, i);
    a[k] = i + 1;
  }
  cin >> n;
  p = n;
  while (p > 0) {
    k = por(p);
    cout << a[k] << " ";
    p = p - k;
  }
  cout << "\n";
  return 0;
}
