#include<iostream>
using namespace std;
int main(){
  int h[10]={1,2,4,8,16,32,64,128,256,512};
  int o,hk;
  while(cin>>o){
    hk = true;
    int w[1023][10]={0};
    for(int i=0;i<10;i++){
      if(h[i]>o) break;
      for(int j=o;j>=0;j--){
	if(j==0) w[h[i]][0] = h[i];
	else if(w[j][0]!=0&&j+h[i]<=o){
	  for(int n=0;n<10;n++){
	    if(w[j][n]==0){
	      for(int m=0;m<n;m++) w[j+h[i]][m] = w[j][m];
	      w[j+h[i]][n] = h[i];
	      break;
	    }
	  }
	}
	if(j==0) w[h[i]][0] = h[i];
      }
    }
      for(int i=0;i<10;i++){
	if(w[o][i]==0) break;
	if(hk!=true) cout << ' ';
	cout << w[o][i];
	if(hk==true) hk = false;
      }
      cout << endl;
  }
  return 0;
}