#include <bits/stdc++.h>
using namespace std;
unsigned long long a, b, a1, bit, x;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> a;
  cin >> b;
  a1 = a;
  for (bit = 0; bit < 64; bit++)
    if ((b >> bit) % 2 == 1) {
      if (a < (1LL << bit)) {
        cout << "-1" << '\n';
        return 0;
      }
      a -= (1LL << bit);
    }
  if (a % 2 != 0) {
    cout << "-1" << '\n';
    return 0;
  }
  x = a / 2;
  for (bit = 0; bit < 64; bit++)
    if ((x >> bit) % 2 == 1 && (b >> bit) % 2 == 1) {
      cout << "-1" << '\n';
      return 0;
    }
  cout << x << " " << a1 - x << '\n';
  return 0;
}
