#include <iostream>
using namespace std;

struct Table
{
	int digit2;
	int digit10;
	int prev;
	int n;
};
int main() {
	int usedtable[10000];
	Table table[10000];
	int i;
	int target = 2439;
	int now, end;
	for(i = 0 ; i < 10000 ; i++)
	{
		usedtable[i] = 0;
	}
	now = 0; end = 1;
	table[0].n = 0;
	while(end > now)
	{
		for(i = 0 ; i < 10 ; i++)
		{
			if((table[now].n + target * i) % 10 < 2)
			{
				int nextnum = (table[now].n + target * i);
				if(nextnum == 1)
				{
					int n = now;
					cout << target << " *" << endl;
					cout << 0;
					while(n)
					{
						cout << table[n].digit10;
						n = table[n].prev;
					}
					cout << " =" << endl;
					n = now;
					cout << 1;
					while(n)
					{
						cout << table[n].digit2;
						n = table[n].prev;
					}
					cout<<endl;
				}
				if(usedtable[nextnum / 10]) continue;
				usedtable[nextnum / 10] = 1;
				table[end].n = nextnum / 10;
				table[end].digit2 = nextnum % 10;
				table[end].digit10 = i;
				table[end].prev = now;
				end++;
			}
		}
		now++;
	}
	return 0;
}