#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  unsigned long long int a, b;
  cin >> a >> b;
  if (a < b)
    cout << -1;
  else if ((a - b) & 1)
    cout << -1;
  else if (a == b)
    cout << "0 " << b;
  else {
    a = ((a - b) >> 1);
    if (a & b)
      cout << -1;
    else {
      unsigned long long int x = (0LL | a);
      unsigned long long int y = a | b;
      cout << x << " " << y;
    }
  }
  return 0;
}
