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