#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<int> v;
  cin >> n;
  int x = 1;
  int i = 1;
  if (n == 1)
    cout << "1";
  else {
    bool dhukse = false;
    while (x <= n) {
      x *= 2;
      if (x == n) {
        cout << i + 1 << endl;
        dhukse = true;
        break;
      } else if (x > n) {
        break;
      }
      i++;
    }
    x /= 2;
    v.push_back(i);
    if (!dhukse)
      while (x != n) {
        v.push_back(1);
        if (v.size() > 1) {
          while (v[v.size() - 1] == v[v.size() - 1 - 1]) {
            v[v.size() - 1 - 1]++;
            v.pop_back();
          }
        }
        x++;
      }
    if (!dhukse) {
      for (int i = 0; i < v.size(); i++) {
        cout << v[i] << " ";
      }
    }
  }
}
