#include <stdio.h>
#include <string.h>
#include <math.h>
// p
// A是素数P-A也是素数
// A from 2 to p/2 step 2?
int isprime(int n);
int main()
{

    int n;
    while (scanf("%d", &n) != EOF)
    {
        int max;
        for (int i = 2; i <= n / 2; i++)
        {
            if (isprime(i) == 1 && isprime(n - i) == 1)
                max = i;
        }
        printf("%d\n%d\n", max, n - max);
    }

    return 0;
}

int isprime(int n)
{
    int ret = 1;
    if (n == 1 || (n % 2 == 0 && n != 2))
        ret = 0;
    else
    {
        for (int i = 3; i <= sqrt(n); i += 2)
            if (n % i == 0)
            {
                ret = 0;
                break;
            }
    }
    return ret;
}