#include <bits/stdc++.h>
#pragma GCC optimize(-O3)
#pragma GCC optimize(Ofast)
#pragma GCC optimize("unroll-loops")
using namespace std;
mt19937_64 rnd(time(NULL));
const long long N = 1e6 + 10;
const long long oo = 1e9 + 10;
const long long B = 500;
const long long mod = 1e9 + 7;
long long n, Q, i, k, l, r, f, c, o, x, y, a[100100];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> k;
  if (n == 9 && k == 1) return cout << "9 10" << endl, 0;
  if (n == k)
    cout << n << 1 << " " << k << 2 << endl;
  else {
    if (k - n != 1) return cout << -1 << endl, 0;
    cout << n << 9 << " " << k << 0 << endl;
  }
  return 0;
}
