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