Go: package main

import (
	"bufio"
	"os"
	"strconv"
	"fmt"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		num, _ := strconv.Atoi(scanner.Text())
		first := true
		beki := 1
		for num != 0 {
			if num % 2 == 1 {
				if !first {
					fmt.Print(" ")
				}
				fmt.Print(beki)
				first = false
			}
			num /= 2
			beki *= 2
		}
		fmt.Println()
	}
}

C++: //#define _GRIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// ???
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long double> vld;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T> int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F> int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T> void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C> void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U> void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U> void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C> void reverse(C& c) { reverse(ALL(c)); }
template<typename C> void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred> void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// ?????°
#pragma region CONST_VAL
constexpr int PI = (2*acos(0.0));
constexpr int EPS = (1e-9);
constexpr int MOD = (int)(1e9+7);
constexpr int INF = 100000000;
#pragma endregion


int main()
{
    int data[10];
    data[0] = 1;
    REP(i,1,10) data[i] = data[i-1] * 2;
    while(true) {
        int n;
        cin >>n;
        if(n==EOF) break;

        bool check[10];
        rep(i, 10) check[i] = false;
        for(int i=9; i>=0; --i) {
            if(n>=data[i]) {
                n -= data[i];
                check[i] = true;
            }
        }

        bool check2 = false;
        rep(i, 10) {
            if(check[i]) {
                if(check2) cout << " ";
                else check2 = true;
                cout << data[i];
            }
        }
        cout << endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
    int n;
    int i;
    int j;
    while(cin >> n){
        i = 1;
        for(j=0;j<10;j++){
            if(n & 1){
                cout << i;
                i <<= 1;
                n >>= 1;
                break;
            }
            i <<= 1;
            n >>= 1;
        }
        for(j=j;j<10;j++){
            if(n & 1){
                cout << " ";
                cout << i;
            }
            i <<= 1;
            n >>= 1;
        }
        cout << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <vector>

using namespace std;

int main(){
  int n;
  while(cin >> n){
    if(cin.eof())break;
    vector<int> ar;
    int flg = 0;   
    for(int i = 512 ; i>=1; i/=2){

      if(n >= i&&flg == 0){
	cout << i;
	flg = 1;
	n-=i; 
	continue;
      }
      if(n >= i&&flg == 1){
	cout <<" "<< i;
	n-=i; 
      }
    }
    cout << endl;
  }
  return 0;
}

C++: // #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cmath>
#include <set>
using namespace std;

int main(){
	int n;
	set<int> ansset;
	while (cin >> n, !cin.eof()){
		ansset.clear();
		for (int i = 9; i >= 0; i--){
			int hundou = pow(2, i);
			if (n >= hundou){
				ansset.insert(hundou);
				n -= hundou;
			}
		}
		// output
		set<int>::iterator it = ansset.begin();
		while (it != ansset.end()){
			cout << *it;
			++it;
			if (it != ansset.end())	
				cout << " ";
		}
		cout << endl;
	}
	return 0;
}

C++:  
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;
 
 int arr[10]={1,2,4,8,16,32,64,128,256,512}; 
  
 int main()
 {
   int N;
   while(cin>>N)
   {
     int count=0;
     int num[10]={0};
     while(N)
     {
       num[count++]=N%2;
       N/=2;        
     }      
     for(int i=0;i<count-1;i++)
     {
       if(num[i]) cout<<arr[num[i]]<<" ";
     }
     if(num[count-1]) cout<<arr[num[count-1]]<<endl;
     else cout<<endl;           
   }
   //while(1);     
   return 0;  
 }

C++: #include <iostream>
#include <cmath>
using namespace std;

int main(){
	int n,f[10],flag;
	while (cin >> n){
		flag = 0;
		for (int i = 0; i < 10; i++) f[i] = 0;
		for (int i = 0; n; i++){
			f[i] = n % 2;
			n /= 2;
		}
		for (int i = 0; i < 10; i++){
			if (f[i]) {
				if(!flag){
					cout << (int)pow(2.0, i);
					flag = 1;
				}
				else cout << " " << (int)pow(2.0, i);
			}
		}
		cout << endl;
	}
}

C++: #include <iostream>
using namespace std;
int main() {
  int a, i;
  while(cin>>a) {
    for(i=0;i<=9;i++) {
      if(a&1<<i){
        cout<<(1<<i);
        if(a<2<<i)break;
        cout<<' ';
      }
    }
    cout<<endl;
  }
}

C++: #include<iostream>

using namespace std;

int bekijou(int);

int main(){

  int in,data[10];

  while(cin >> in){

    for(int i = 0; i < 10; i++) data[i] = 0;

    for(int i = 0;i < 10; i++){
      data[i] = in % 2;
      in /= 2;
    }
    int out = 0;

    for(int i = 0; i < 10; i++){
      if(data[i] == 1 && out == 0){
	cout << bekijou(i);
	out++;
      }else if(data[i] == 1){
	cout << " " << bekijou(i);
      }
    }
    cout << endl;
  }
  return 0;
}
  
int bekijou(int n){
  int ret = 1;

  for(int i = 0; i < n; i++){
    ret *= 2;
  }

  return ret;
}

C++: #include<iostream>
#include<cmath>
using namespace std;

int main(){
	int n;
	int ans[10] = {};
	while(cin >> n){
		while(n >= 512){
			n -= 512;
			ans[9]++;
		}
		while(n >= 256){
			n -= 256;
			ans[8]++;
		}
		while(n >= 128){
			n -= 128;
			ans[7]++;
		}
		while(n >= 64){
			n -= 64;
			ans[6]++;
		}
		while(n >= 32){
			n -= 32;
			ans[5]++;
		}
		while(n >= 16){
			n -= 16;
			ans[4]++;
		}
		while(n >= 8){
			n -= 8;
			ans[3]++;
		}
		while(n >= 4){
			n -= 4;
			ans[2]++;
		}
		while(n >= 2){
			n -= 2;
			ans[1]++;
		}
		while(n >= 1){
			n -= 1;
			ans[0]++;
		}

		for(int i = 0; i < 10; i++){
			if(ans[i] == 0) continue;
			cout << pow(2, i);
			if(i < 9) cout << " ";
		}
		cout << endl;


	}


}

C++: #include<iostream>
#include<string>
#include<vector>
using namespace std;

int main(){
	int n;
	int ary[] = { 512, 256, 128, 64, 32, 16, 8, 4, 2, 1 };

	while (cin >> n){
		vector<int> v;
		for (int i = 0; i < 10; i++){
			if (n >= ary[i]){
				n -= ary[i];
				v.push_back(ary[i]);
			}
		}
		for (auto i = v.rbegin(); i < v.rend(); i++){
			if (i != v.rbegin()) cout << " ";
			cout << *i;
		}
		cout << endl;
		n = 0;
	}
	return 0;
}