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