#include <bits/stdc++.h>
using namespace std;
int n, LastMin, LastMax;
bool Deleted[1000005];
void solve() {
  int Cnt = n;
  for (int Base = 2; Base <= n; Base <<= 1)
    for (int i = (Base >> 1); i <= n; i += Base) {
      if (Cnt == 2) return;
      printf("%d ", Base >> 1);
      Cnt--;
      Deleted[i] = true;
    }
}
int gcd(int A, int B) { return (!B) ? (A) : (gcd(B, A % B)); }
int main() {
  scanf("%d", &n);
  if (n == 1) {
    printf("1");
    return 0;
  }
  solve();
  for (int i = 1; i <= n; i++)
    if (!Deleted[i]) {
      LastMin = i;
      break;
    }
  for (int i = n; i >= 1; i--)
    if (!Deleted[i]) {
      LastMax = i;
      break;
    }
  printf("%d %d", gcd(LastMin, LastMax), LastMax);
  return 0;
}
