#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<climits>
#include<map>
#include<set>
#include<cassert>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define INF 1<<30
using namespace std;

int main(){
  int n;
   vector<int> dp[1024];
  
  for(int i=1;i<=1023;i++){
    if(i == 1 || i == 2 || i == 4 || i == 8 || i == 16 || i == 32 || i == 64 || i == 128 || i == 256 || i == 512){
      dp[i].push_back(i);
      continue;
    }
    if(dp[i].empty()){
      int index,bg;
      bg = i-1;
      for(int j=1;j<bg;j++){
	index = bg+j;
	for(int k=0;k<dp[j].size();k++){
	  dp[index].push_back(dp[j][k]);
	}
	for(int k=0;k<dp[bg].size();k++){
	  dp[index].push_back(dp[bg][k]);
	}
      }
    }
  }

  while(cin >> n){
    assert(n<=1023);
    for(int i=0;i<dp[n].size();i++){
      cout << dp[n][i];
      i==dp[n].size()-1?cout << endl:cout << " ";
    }


  }
    return 0;
}