#include <bits/stdc++.h>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
using std::pair;
using std::tuple;
using std::vector;
pair<uint64_t, uint64_t> ReadData();
pair<uint64_t, uint64_t> Solution(const pair<uint64_t, uint64_t>& numbers);
void WriteData(const pair<uint64_t, uint64_t>& answer);
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  try {
    auto input = ReadData();
    auto output = Solution(input);
    WriteData(output);
  } catch (...) {
    cout << "-1";
  }
  return 0;
}
pair<uint64_t, uint64_t> Solution(const pair<uint64_t, uint64_t>& numbers) {
  cerr << numbers.first << " " << numbers.second << endl;
  if (numbers.first < numbers.second) {
    cerr << "OK1";
    throw std::exception();
  }
  cerr << numbers.first << " " << numbers.second << endl;
  if ((numbers.first % 2) != (numbers.second % 2)) {
    cerr << "OK2";
    throw std::exception();
  }
  uint64_t x = (numbers.first - numbers.second) >> 1;
  uint64_t y = x + numbers.second;
  if ((x & (numbers.first - x)) != x) {
    cerr << "OK3";
    throw std::exception();
  }
  return {x, y};
};
pair<uint64_t, uint64_t> ReadData() {
  uint64_t a, b;
  cin >> a >> b;
  cerr << a << " " << b << endl;
  return {a, b};
};
void WriteData(const pair<uint64_t, uint64_t>& answer) {
  cout << std::min(answer.first, answer.second) << " "
       << std::max(answer.first, answer.second);
}
