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