#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int m, n, a[100000], i, b[100000], c = 0, d = 0, e = 0, f = 0;
  cin >> m >> n;
  if (m == n) {
    c = m * 10;
    d = c + 1;
  } else if (m == 9 && n == 1) {
    c = 9;
    d = c + 1;
  } else if ((m + 1) == n) {
    d = n;
    c = m;
  } else {
    cout << -1;
    return 0;
  }
  cout << c << " " << d;
  return 0;
}
