#include<iostream>
#include<vector>
#include<cassert>
using namespace std;
int main(){
  int n,index,bg;
  vector<int> dp[1024];
  for(int i=1;i<=1023;i++){
    if(!dp[i].empty())continue;
    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;
    }  
    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;
}