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