#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> row;
  for (int used = n; used != 0; used--) {
    row.push_back(1);
    if (row.back() != row[(row.size()) - 2]) {
      continue;
    } else {
      while (row.back() == row[(row.size()) - 2]) {
        row[(row.size()) - 2] += 1;
        row.pop_back();
      }
    }
  }
  for (int i = 0; i < int(row.size()); i++) {
    cout << row[i] << " ";
  }
}
