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