#include <bits/stdc++.h>
using namespace std;
unsigned long long int a, b, j, k, x, y;
int i;
int main() {
  cin >> a >> b;
  if (a < b) {
    cout << -1;
    return 0;
  }
  if ((a - b) & 1) {
    cout << -1;
    return 0;
  }
  a = (a - b) >> 1;
  x = y = 0;
  for (i = 63; i >= 0; i--) {
    j = (a & (1ll << i));
    k = (b & (1ll << i));
    if (j != 0 && k == 0) {
      x = x << 1 | 1;
      y = y << 1 | 1;
    } else if (j != 0 && k != 0) {
      printf("-1");
      return 0;
    } else if (j == 0 && k != 0) {
      x = x << 1;
      y = y << 1 | 1;
    } else {
      x = x << 1;
      y = y << 1;
    }
  }
  cout << x << " " << y;
  return 0;
}
