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