#include <bits/stdc++.h>
using namespace std;
map<pair<unsigned long long, unsigned long long>,
    pair<unsigned long long, bool> >
    memo;
pair<unsigned long long, bool> dfs(unsigned long long A, unsigned long long B) {
  pair<unsigned long long, unsigned long long> argu = make_pair(A, B);
  if (((memo).find(argu) != (memo).end())) return memo[argu];
  if (A == 0ULL) {
    if (B != 0ULL) return make_pair(0ULL, false);
    return make_pair(0ULL, true);
  }
  if (A % 2ULL != B % 2ULL) return memo[argu] = make_pair(0ULL, false);
  for (unsigned long long val = 0; val < (unsigned long long)(2); ++val) {
    pair<unsigned long long, bool> tmp = dfs((A - val) / 2ULL, B / 2ULL);
    if (tmp.second) return memo[argu] = make_pair(tmp.first * 2 + val, true);
  }
  return memo[argu] = make_pair(0ULL, false);
}
int main() {
  unsigned long long A, B;
  while (cin >> A >> B) {
    memo.clear();
    pair<unsigned long long, bool> res = dfs(A, B);
    if (res.second == false)
      puts("-1");
    else
      cout << (res.first) << " " << (A - (res.first)) << endl;
  }
}
