import std.experimental.all; T read(T)() { return readln.chomp.to!T; } T[] reads(T)() { return readln.split.to!(T[]); } alias readint = read!int; alias readints = reads!int; void calc(long n) { for (int a = 3; ; a++) { long b = n - a; if (a > b) break; if (!isPowerOf2(a) && !isPowerOf2(b)) { writeln(a, " ", b); return; } } writeln(-1); } void main() { long n = read!long; calc(n); }