#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> d[1000][2];
bool w[1000][2];
unsigned long long a, b;
int getlen(long long x) {
  int ans = 0;
  while (x > 0) {
    ans++;
    x /= 2;
  }
  return ans;
}
bool check(long long a, long long b) {
  if (a == 0 && b == 0) return true;
  if (a != 0 && b != 0) return true;
  return false;
}
int main() {
  scanf("%llu %llu", &a, &b);
  cerr << a << endl;
  int len = getlen(a);
  len = max(len, getlen(b));
  for (int x = 0; x < 2; x++)
    for (int y = 0; y < 2; y++)
      if ((b % 2 == (x ^ y)) && (a % 2 == (x ^ y))) {
        if (!w[0][(x & y)] || d[0][(x & y)].first > x)
          d[0][(x & y)] = make_pair(x, y);
        w[0][(x & y)] = true;
      }
  for (int i = 0; i < len; i++)
    for (int carry = 0; carry < 2; carry++) {
      if (w[i][carry]) {
        long long xx = d[i][carry].first;
        long long yy = d[i][carry].second;
        for (long long x = 0ll; x < 2ll; x++)
          for (long long y = 0ll; y < 2ll; y++) {
            if (check((x ^ y), (b & (1ll << (1ll + i)))) &&
                check((x ^ y ^ carry), (a & (1ll << (1ll + i))))) {
              long long tx = xx | (x << (i + 1ll));
              long long ty = yy | (y << (i + 1ll));
              int tc = 0;
              if ((x + y + carry) > 1) {
                tc = 1;
              }
              if (!w[i + 1][tc] || d[i + 1][tc].first > tx) {
                d[i + 1][tc] = make_pair(tx, ty);
                w[i + 1][tc] = true;
              }
            }
          }
      }
    }
  if (w[len][0])
    cout << d[len][0].first << " " << d[len][0].second << endl;
  else
    cout << -1 << endl;
  return 0;
}
