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