#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, res;
  cin >> a >> b;
  res = -1;
  if (a == b) {
    a = a * 10;
    b = a + 1;
    res = 1;
  } else if ((b - a) == 1) {
    b = b * 10;
    a = b - 1;
    res = 1;
  } else if (a == 9 && b == 1) {
    b = 10;
    res = 1;
  }
  if (res == 1)
    cout << a << ' ' << b;
  else
    cout << "-1";
  return (0);
}
