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