#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int a, b;
  cin >> a >> b;
  unsigned long long int an = (a - b) / 2;
  unsigned long long int x = 0, y = 0;
  unsigned long long int po = 1;
  while (b > 0 || an > 0) {
    unsigned long long int d1 = an % 2;
    unsigned long long int d2 = b % 2;
    an /= 2;
    b /= 2;
    if (d1 == 1 && d2 == 0) {
      x += po;
      y += po;
    } else if (d1 == 0 && d2 == 1)
      y += po;
    else if (d1 == 1 && d2 == 1) {
      cout << -1;
      return 0;
    }
    po *= 2;
  }
  cout << x << " " << y;
}
