#include <string>
#include <iostream>
#include <math.h>

using namespace std;

void c(int x,string r){int i,t=0,s=r.size();if(s<8){if(r[0]>48){for(i=0;i<s;i++)t+=(r[s-i-1]-48)*1<<i;if(t==x)cout<<r<<" ";}for(char n=48;n<51;n++)c(x,r+n);}}

int main()
{
	int xs[] = { 2, 9, 10, 23, 37 };
	for (int x : xs)
	{
		string t;
		cout << x << ": ";
		c(x, t);
	    cout << endl;
	}
	return 0;
}
