#include<iostream>
using namespace std;
int a[10];//用来记录使用过的数字;用过赋值为1
int ans;
void init()
{for(int i=0;i<10;i++){a[i]=0;}ans=0;
}
int Judge(int x,int y)
{if(y>98765)return 0;init();if(x<10000)a[0]=1;while(x){a[x%10]=1;x/=10;}while(y){a[y%10]=1;y/=10;}for(int i=0;i<10;i++){ans+=a[i];}return (ans==10);
}
int main()
{int N,T=0;while(~scanf("%d",&N)&&N){if(T++)cout<<endl;int count=0;for(int i=1234;i<100000;i++){if(Judge(i,i*N)){printf("%05d / %05d = %d\n",i*N,i,N);count++;}}if(!count)printf("There are no solutions for %d.\n",N);}return 0;
}