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