local ffi = require 'ffi' local C = ffi.C ffi.cdef [[ long atol(const char *); ]] print((function (f, n) local h,m,t = {},n/2LL,3LL for i=0,58 do if 2LL^i>=n then break end h[tostring(2LL^i)]=0 end while t<=m do if h[tostring(n-t)]==nil then break end t=t+2LL end return t<=m and f(t,n-t) or -1 end)(function (l, r) return tostring(l):sub(1,-3).." "..tostring(r):sub(1,-3) end, C.atol(io.stdin:read("*l"))))