#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int i, j, t1, t2, t3, t4, x, y, a, b;
  cin >> a >> b;
  if (a < b || a % 2 != b % 2) {
    printf("-1\n");
    return 0;
  }
  x = (a - b) / 2;
  y = b + x;
  if ((x & y) != x) {
    printf("-1\n");
    return 0;
  }
  cout << x << " " << y << endl;
  return 0;
}
