#include <bits/stdc++.h>
using namespace std;
unsigned long long X, Y, sum, exor, l, m;
int main() {
  cin >> sum >> exor;
  if (sum < exor || sum % 2 != exor % 2) {
    cout << "-1" << endl;
    return 0;
  }
  X = (sum - exor) / 2;
  Y = sum - X;
  cout << X << endl << Y << endl;
}
