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