#include <bits/stdc++.h>
using namespace std;
const int len = 10;
inline bitset<len> bin(unsigned long long a) {
  bitset<len> x(a);
  return x;
}
int main() {
  unsigned long long a, b;
  cin >> a >> b;
  if (a < b || (a - b) & 1ll)
    cout << -1;
  else {
    unsigned long long x = (a - b) / 2;
    unsigned long long y = x + b;
    if ((x & y) != x)
      cout << -1;
    else
      cout << x << " " << y;
  }
}
