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