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