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