#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long A, B;
  cin >> A >> B;
  if (A < B) {
    puts("-1");
    return 0;
  }
  if ((A - B) % 2 != 0) {
    puts("-1");
    return 0;
  }
  unsigned long long C = (A - B) / 2;
  unsigned long long X = 0, Y = 0;
  for (unsigned long long bit = 1ULL << 63; bit >= 1; bit >>= 1) {
    bool dif = (B & bit);
    bool allHas = (C & bit);
    if (allHas && dif) {
      puts("-1");
      return 0;
    }
    if (allHas) {
      X |= bit;
      Y |= bit;
    }
    if (dif) {
      Y |= bit;
    }
  }
  cout << X << " " << Y << endl;
}
