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