#include <bits/stdc++.h>
using namespace std;
int num[31];
int main() {
  int n;
  scanf("%d", &n);
  memset(num, 0, sizeof(num));
  num[1] = 1;
  for (int i = 2; i <= 29; i++) {
    num[i] = num[i - 1] * 2;
  }
  while (n != 0) {
    for (int i = 29; i >= 1; i--) {
      while (n >= num[i]) {
        n -= num[i];
        cout << i << ' ';
      }
    }
  }
  return 0;
}
