#include <bits/stdc++.h>
using namespace std;
using ulli = unsigned long long;
int main() {
  ulli a, b;
  scanf("%llu %llu", &a, &b);
  if (a < b || ((a & 1ll) ^ (b & 1ll))) {
    puts("-1");
    return 0;
  }
  ulli x = (a - b) / 2;
  ulli y = x + b;
  (x + y == a && (x ^ y) == b) ? printf("%llu %llu\n", x, y) : puts("-1");
  return 0;
}
