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