#include <iostream>
using namespace std;
bool isLegal (int a, int b) {
int used[10] = {0}; // C++里可以这样
while (a) {
used[a % 10]++;
a /= 10;
}
while(b) {
used[b % 10]++;
b /= 10;
}
for (int i = 1; i < 10; i++)
if (used[i] != 1)
return false;
return true;
}
int main() {
int n = 0;
int ncase = 0;
while (cin >> n && n) {
if (ncase++)
cout << endl;
int fghij = 1234; // 从01234开始
bool legal = false;
while (n * fghij <= 98765) {
if (isLegal(n*fghij, fghij)) {
legal = true;
printf("%05d / %05d = %d\n", fghij*n, fghij, n);
}
fghij++;
}
if (!legal)
printf("There are no solutions for %d.\n", n);
}
}