#include using namespace std; typedef long long ll; int main() { int n, z; cin >> n >> z; if (n > 2) cout << -1 << endl; else if (n == 1) { if (z == 1) cout << -1 << endl; else cout << 1 << " " << z-1 << endl; } else { bool ok = false; for (int x = 1; x < z; ++x) { for (int y = x; y < z; ++y) { if (x*x + y*y == z*z) { cout << x << " " << y << endl; ok = true; break; } } if (ok) break; } if (!ok) cout << -1 << endl; } return 0; }