#include <bits/stdc++.h>
using namespace std;
unsigned long long a, b;
int main() {
  cin >> a >> b;
  if (a >= b && (((a - b) / 2) ^ ((a + b) / 2)) == b)
    cout << (a - b) / 2 << " " << (a + b) / 2;
  else
    cout << "-1";
  return 0;
}
