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