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