#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  int ans1, ans2;
  cin >> a >> b;
  if (b - a >= 2) {
    cout << -1 << endl;
    return 0;
  } else if (a > b) {
    ans1 = a;
    ans2 = b * 10;
    if (a + 1 == ans2) {
      cout << ans1 << " " << ans2 << endl;
      return 0;
    } else {
      cout << -1 << endl;
      return 0;
    }
  } else if (a != b) {
    ans1 = a * 10 + 9;
    ans2 = b * 10;
    cout << ans1 << " " << ans2 << endl;
  } else {
    ans1 = a * 10 + 1;
    ans2 = b * 10 + 2;
    cout << ans1 << " " << ans2 << endl;
    return 0;
  }
}
