#include <stdio.h>

int main() {
    int N,A,B;
    scanf("%d", &N);

    for (A = 1; A <= 8; A++) {
        for (B = A + 1; B <= 9; B++) {
            int AB = A * 10 + B;
            int BA = B * 10 + A;
            if (AB * BA == N) {
                printf("%d%d\n", A, B);
                break;
            }
        }
    }

    return 0;
}
