#include <bits/stdc++.h>
int n;
int log(int x, int sayac) {
  if (x < 2) {
    return sayac;
  }
  return log(x / 2, sayac + 1);
  ;
}
int fpow(int a, int b) {
  if (b == 0) return 1;
  int x = fpow(a, b / 2);
  x = x * x;
  if (b % 2) x = x * a;
  return x;
}
int main() {
  scanf("%d", &n);
  while (1) {
    if (n == fpow(2, log(n, 0))) {
      printf("%d ", log(n, 0) + 1);
      break;
    } else {
      printf("%d ", log(n, 0) + 1);
      n = n - fpow(2, log(n, 0));
      continue;
    }
  }
}
