#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  unsigned long long a, b;
  cin >> a >> b;
  unsigned long long x = a - b;
  if (a < b || (a & 1) != (b & 1)) {
    cout << -1 << endl;
    return 0;
  }
  x /= 2;
  unsigned long long y = a - x;
  if (a < x || (x ^ y) != b) {
    cout << -1 << endl;
    return 0;
  }
  cout << min(x, y) << " " << max(x, y);
  return EXIT_SUCCESS;
}
