#include <bits/stdc++.h>
using namespace std;
bool myfunction(int a[], int n);
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) a[i] = 1;
  while (1) {
    if (!myfunction(a, n)) break;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] != 0) cout << a[i] << ' ';
  }
  return 0;
}
bool myfunction(int a[], int n) {
  int c = 0;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] == a[i + 1] && a[i] != 0) {
      a[i]++;
      a[i + 1] = 0;
      c++;
      i++;
    }
  }
  sort(a, a + n, greater<int>());
  if (c > 0)
    return 1;
  else
    return 0;
}
