using System; namespace prob638 { class Program { public static ulong[] data = new ulong[60]; static void Main(string[] args) { data[0] = 1; for (int i = 1; i < 60; i++) { data[i] = data[i-1] * 2; } long a = long.Parse(Console.ReadLine()); long ret = -1; bool flg = false; for (long i = 1; i < a/2+1; i++) { if (!ispower2((ulong)i) && !ispower2((ulong)(a - i))) { flg = true; ret = i; break; } else { flg = false; } } if (flg==false) { Console.WriteLine(-1); } else { Console.WriteLine("{0} {1}", ret,(long)(a-ret)); } } static bool ispower2(ulong v) { if (Array.IndexOf(data, v)>-1) { return true; } else { return false; } } } }