#include <bits/stdc++.h>
using namespace std;
int firstdigit(int n) {
  while (n >= 10) {
    n /= 10;
  }
  return n;
}
int main() {
  int a, b;
  cin >> a >> b;
  if (firstdigit(a) == firstdigit(b)) {
    int y = firstdigit(a);
    cout << (y * 10) << " " << (y * 10 + 1) << "\n";
  } else if (firstdigit(a) == 9 && firstdigit(b) == 1) {
    cout << 999 << " " << 1000 << "\n";
  } else if (firstdigit(b) - firstdigit(a) == 1) {
    cout << (firstdigit(b) * 100 - 1) << " " << (firstdigit(b) * 100) << "\n";
  } else {
    cout << -1 << "\n";
  }
}
