import java.util.Scanner;
public class Problem {
	public static void main(String[] args) {
		Scanner scanf = new Scanner(System.in);
		int n, c, k, y;
		int s[] = new int[10];
		while (true)
		{
			n = scanf.nextInt();
			if (n < 2)
				break;
			c = -1;
			do
			{
				k = 2;
				while (n%k != 0)
					k++;
				c++;
				s[c] = k;
				n /= k;
			} while (n != 1);
			if (c == 0)
				System.out.println("¼Ò¼ö");
			else
			{
				for (y = 0; y <= c - 1; y++)
					System.out.printf("%dX", s[y]);
				System.out.printf("%d", s[c]);
			}
		}
		scanf.close();
	}
}