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