#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int a, b;
  cin >> a >> b;
  if (b - a == 1) {
    cout << a << ' ' << b;
  } else if (b == a) {
    cout << a * 10 << ' ' << a * 10 + 1;
  } else if (b == 1 && a == 9) {
    cout << 9 << ' ' << 10;
  } else {
    cout << -1;
  }
  return 0;
}
