#include <bits/stdc++.h>
using namespace std;
unsigned long long a, b;
unsigned long long x, y;
bool ok = 1;
int carry;
int main() {
  scanf("%llu%llu", &a, &b);
  for (int i = 63; i >= 0; --i) {
    if ((a >> i & 1) && (b >> i & 1)) {
      if (carry) {
        ok = 0;
        break;
      } else {
        y |= 1ull << i;
      }
    } else if ((a >> i & 1) && !(b >> i & 1)) {
      if (carry) {
        x |= 1ull << i;
        y |= 1ull << i;
      }
      carry = 1;
    } else if (!(a >> i & 1) && (b >> i & 1)) {
      if (!carry) {
        ok = 0;
        break;
      } else {
        y |= 1ull << i;
      }
    } else {
      if (carry) {
        x |= 1ull << i;
        y |= 1ull << i;
      }
      carry = 0;
    }
  }
  if (ok) {
    printf("%llu %llu\n", x, y);
  } else {
    puts("-1");
  }
  return 0;
}
