#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  long long r;
  if (b == 0) return 1;
  while (b > 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int arrx[2001];
int arry[2001];
int main() {
  int a, b, n, ans = 0, x1, y1, x2, y2;
  cin >> a >> b;
  if (a == b)
    cout << b << "0 " << b << "1";
  else {
    if (a + 1 == b)
      cout << a << "9 " << b << "0";
    else {
      if (b == 1 && a == 9)
        cout << "9 10";
      else
        cout << -1;
    }
  }
  return 0;
}
