using System; namespace prob638 { class Program { public static ulong[] data = new ulong[60]; static void Main(string[] args) { for (int i = 0; i < 55; i++) { data[i] = (ulong)Math.Pow(2, i); } long a = long.Parse(Console.ReadLine()); long ret = -1; bool flg = false; for (long i = 1; i < a/2+1; i++) { if (!ispower2(i) && !ispower2(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(float v) { for (int i = 0; i < 55; i++) { if (v == data[i]) { return true; } if (data[i]>v) { return false; } } return false; } } }