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