#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main(){

  int weight;
  int n;

  while(cin>>weight,weight){
    vector<int> result;
    while(1){
      if(weight == 1 || weight ==2 || weight ==4 || weight ==8 || weight ==16 || weight ==32 || weight ==64 || weight ==128 || weight ==256 || weight ==512){
	result.push_back(weight);
	break;
      }
     
      n=weight/2+weight%2;

      result.push_back(n);
      weight-=n;
    }

    sort(result.begin(),result.end());

    for(auto i:result)
      cout<<i<<" ";
    cout<<endl;
  }
}