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