#include <bits/stdc++.h>
using namespace std;
int nm[32];
int main() {
  int n;
  nm[0] = 1;
  for (int i = 1; i <= 16; i++) {
    nm[i] = nm[i - 1] * 2;
  }
  while (~scanf("%d", &n)) {
    while (n) {
      for (int i = 0; i <= 16; i++) {
        if (nm[i] == n) {
          printf("%d\n", i + 1);
          n -= nm[i];
          break;
        } else if (nm[i + 1] > n || i == 16) {
          printf("%d ", i + 1);
          n -= nm[i];
          break;
        }
      }
    }
  }
}
