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