#include <bits/stdc++.h>
using namespace std;
unsigned long long A, B, D;
int a[70], b[70], len1, len2;
int main() {
  cin >> A >> B;
  D = A - B;
  unsigned long long temp = A;
  if (A < B) {
    cout << -1 << endl;
    return 0;
  }
  while (A) {
    a[len1++] = A % 2;
    A /= 2;
  }
  while (B) {
    b[len2++] = B % 2;
    B /= 2;
  }
  unsigned long long res = 0;
  for (int i = len1 - 1; i >= 0; --i) {
    if (!b[i]) {
      unsigned long long n = (1ULL << i);
      if (n <= D / 2.0) {
        D -= 2 * n;
        res += n;
      }
    }
  }
  if (D) {
    cout << -1 << endl;
    return 0;
  }
  cout << res << " " << temp - res << endl;
  return 0;
}
