#include <bits/stdc++.h>
using namespace std;
int arr[100008];
int main() {
  int i, j, k, t, n, m, a, b, c, x, y, z, cs;
  int cur = 0;
  cin >> n;
  for (i = 1; i <= n; i++) {
    arr[++cur] = 1;
    while (arr[cur - 1] == arr[cur]) {
      arr[cur - 1] = arr[cur] + 1;
      cur--;
    }
  }
  for (i = 1; i <= cur; i++) cout << arr[i] << " ";
  return 0;
}
