#include <bits/stdc++.h>
using namespace std;
unsigned long long a, b, x, y;
int main() {
  cin >> a >> b;
  if (a < b)
    cout << -1;
  else {
    if ((a - b) % 2 != 0)
      cout << -1;
    else {
      x = (a - b) / 2;
      y = x + b;
      if ((x + y == a) && ((x ^ y) == b))
        cout << x << ' ' << y;
      else
        cout << -1;
    }
  }
  return 0;
}
