#include <bits/stdc++.h>
using namespace std;
auto seed = chrono::high_resolution_clock::now().time_since_epoch().count();
mt19937 mt(seed);
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long a, b;
  cin >> a >> b;
  if (a == b) {
    cout << a << "0 " << b << "1";
  } else if (a + 1 == b) {
    cout << a << "9 " << b << "0";
  } else if (a == 9 && b == 1) {
    cout << "9 10";
  } else
    cout << -1;
  return 0;
}
