#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  int s = 0, i;
  cin >> n;
  while (n != 0) {
    s = 0;
    for (i = 0;; ++i) {
      s += (1 << i);
      if (s >= n) break;
    }
    if (s == n) {
      cout << i + 1 << " ";
      n -= (1 << i);
    } else {
      cout << i + 1 << " ";
      n -= (1 << i);
    }
  }
  cout << "\n";
  return 0;
}
