#include #include #include #include #include using ll = long long; using namespace std; const int MOD = 1e9+7; int main() { ll n; cin >> n; if (n != 6 && n <= 7) { cout << -1 << endl; } else if (n == 6) { cout << "3 3" << endl; } else { bool two3, two5, two6; two3 = two5 = two6 = false; for(int i = 0; i < 64; i++) { ll a = (1LL << i); if ((n - 3) == a) two3 = true; if ((n - 5) == a) two5 = true; if ((n - 6) == a) two6 = true; if (two3 && two5 && two6) break; } if (!two3) { cout << "3 " << n - 3 << endl; } else if (!two5) { cout << "5 " << n - 5 << endl; } else if (!two6) { cout << "6 " << n - 6 << endl; } else { cout << -1 << endl; } } return 0; }