#include <bits/stdc++.h>
using namespace std;
const int maxn = 100;
const int INF = 99999999;
unsigned long long A, B, AA, BB, X = 0, Y = 0;
int a[maxn], b[maxn], x[maxn], y[maxn], on = 0;
bool BT(int d) {
  if (d == -1) return (on == 0);
  int s = a[d] + 2 * on;
  if (b[d] == 0) {
    on = (s % 2);
    x[d] = y[d] = s / 2;
  } else {
    if (s == 0 || s == 3) return false;
    x[d] = 0;
    y[d] = 1;
    if (s == 2) on = 1;
  }
  return BT(d - 1);
}
bool zero() {
  for (int i = 0; i < maxn; i++)
    if (x[i]) {
      return false;
    }
  return true;
}
bool change() {
  int o = 0;
  for (int i = 0; i < maxn; i++) o += y[i];
  if (o < 2) return false;
  for (int i = 0; i < maxn; i++)
    if (y[i]) {
      swap(y[i], x[i]);
      return true;
    }
}
int main() {
  cin >> A >> B;
  AA = A;
  BB = B;
  for (int i = 0; A; i++) {
    a[i] = A % 2;
    A /= 2;
  }
  for (int i = 0; B; i++) {
    b[i] = B % 2;
    B /= 2;
  }
  if (BT(80) == false) {
    cout << "-1" << endl;
    return 0;
  }
  for (int i = 80; i >= 0; i--) X = 2 * X + x[i];
  for (int i = 80; i >= 0; i--) Y = 2 * Y + y[i];
  cout << X << " " << Y << endl;
  return 0;
}
