#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t = 1;
  while (t--) {
    long long a, b;
    cin >> a >> b;
    if (a == 9 and b == 1)
      cout << 9 << " 10";
    else if (a > b || b - a > 1)
      cout << -1;
    else {
      if (a == b)
        cout << a << "1 " << a << "2";
      else
        cout << a << "9 " << b << "0";
    }
  }
}
