#include <bits/stdc++.h>
using namespace std;
unsigned long long A, B, X, Y;
int main() {
  cin >> A >> B;
  if (A < B) {
    cout << -1 << endl;
    return 0;
  }
  if ((A - B) % 2) {
    cout << -1 << endl;
    return 0;
  }
  X = (A - B) / 2LL;
  Y = A - X;
  if ((X ^ Y) != B) {
    cout << -1 << endl;
    return 0;
  }
  cout << X << " " << Y << endl;
}
