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