#include <bits/stdc++.h>
using namespace std;
const long long maxN = 1e18;
const long long minN = -1e18;
const long long MOD = 1e9 + 7;
const long long MOD1 = 998244353;
const int baseHash = 331;
const int bigNumLength = 5000;
const long double PI = acos(-1);
const long long limit = 2e5 + 5;
const long long limit1 = 1e6 + 5;
const long long limit2 = 1e3 + 5;
pair<int, int> dir[] = {{0, 1}, {1, 0},  {0, -1}, {-1, 0},
                        {1, 1}, {1, -1}, {-1, 1}, {-1, -1}};
pair<int, int> NON = {-1, -1};
long long n;
vector<long long> cur, tmp;
void solveProblem() {
  if (n == 1)
    cout << 1 << '\n';
  else if (n == 2)
    cout << 1 << " " << 2 << '\n';
  else if (n == 3)
    cout << 1 << " " << 1 << " " << 3 << '\n';
  else {
    for (int i = (1); i <= ((n + 1) / 2); ++i) cout << 1 << " ";
    for (int i = (1); i <= (n); ++i)
      if (i % 2 == 0) {
        cur.push_back(i);
        tmp.push_back(i);
      }
    long long ok = 2;
    for (int i = 4; (i <= n / 2 || i * 2 % n == 0 && i <= n); i *= 2) {
      ok = i;
      cur.clear();
      for (auto it : tmp)
        if (it % i == 0)
          cur.push_back(it);
        else
          cout << i / 2 << " ";
      tmp.clear();
      for (auto it : cur) tmp.push_back(it);
    }
    if (ok != cur[cur.size() - 1]) {
      long long m = cur[cur.size() - 1];
      for (auto it : cur) {
        if (it != (m % 2 == 0 ? m : m - 1)) cout << ok << " ";
      }
      cout << (m % 2 == 0 ? m : m - 1) << '\n';
    } else {
      cout << cur[cur.size() - 1] << '\n';
    }
  }
}
void fastInput() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
void readInput() { cin >> n; }
int main() {
  fastInput();
  readInput();
  solveProblem();
}
