import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int readint() {
    return readln.chomp.to!int;
}

int[] readints() {
    return readln.split.to!(int[]);
}

bool isPowerOfTwo(long n) {
    if (n <= 0)
        return false;
    return !(n & (n - 1));
}

void calc(long n) {

    for (int a = 3;; a++) {
        auto b = n - a;
        if (a > b)
            break;

        if (!isPowerOfTwo(a) && !isPowerOfTwo(b)) {
            writeln(a, " ", b);
            return;
        }
    }

    writeln(-1);
}

void main() {
    auto n = readln.chomp.to!long;
    calc(n);
}