#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const long long mod = 1e9 + 7, nmax = 2e6 + 10;
long long fl = 0, a[nmax], b[nmax];
signed main() {
  long long st2[64];
  st2[0] = 1;
  for (long long i = 1; i < 64; i++) st2[i] = st2[i - 1] * 2;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  if (n == 3) {
    cout << 1 << ' ' << 1 << ' ' << 3;
    return 0;
  }
  long long q = 1, s = 0;
  while (q * 2 <= n) s++, q *= 2;
  long long ans[s + 2];
  for (long long j = s; j >= 0; j--) ans[j] = 0;
  for (long long i = 1; i <= n; i++)
    for (long long j = s; j >= 0; j--)
      if (i % st2[j] == 0) {
        ans[j]++;
        break;
      }
  for (long long i = 0; i <= s; i++)
    if (i == s)
      cout << n / st2[i - 1] * st2[i - 1];
    else
      while (ans[i]--) cout << st2[i] << ' ';
}
