#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long p, q;
  cin >> p >> q;
  unsigned long long a = 0, b = 0;
  int i = 0;
  while (p || q) {
    if ((p & 1) != (q & 1)) {
      cout << -1;
      return 0;
    }
    if (q & 1) {
      b |= (1LLU << i);
    } else {
      if ((p & 2) != (q & 2)) {
        if (p < 2) {
          cout << -1;
          return 0;
        }
        p -= 2;
        a |= (1LLU << i);
        b |= (1LLU << i);
      } else {
      }
    }
    p /= 2;
    q /= 2;
    i++;
  }
  cout << a << ' ' << b;
}
