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