#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  unsigned long long int s, x;
  cin >> s >> x;
  unsigned long long int a = (s - x) / 2LL;
  unsigned long long int i = 0;
  unsigned long long int mini = 0, maxi = 0;
  unsigned long long int ref = (x >= a ? x : a);
  while (((1LL) << i) <= ref) {
    unsigned long long int t = (1LL) << i;
    if (!(t & x) && !(t & a)) {
      mini += 0;
      maxi += 0;
    } else if ((t & x) && !(t & a)) {
      mini += 0;
      maxi += t;
    } else if (!(t & x) && (t & a)) {
      mini += t;
      maxi += t;
    }
    i++;
  }
  if ((mini + maxi) != s || (mini ^ maxi) != x) {
    cout << -1 << '\n';
    return 0;
  }
  cout << mini << " " << maxi << '\n';
  return 0;
}
