#include <bits/stdc++.h>
const long double pi = 3.1415926536;
using namespace std;
void solve() {
  int a, b;
  cin >> a >> b;
  if (a == b - 1) {
    cout << a << " " << b << "\n";
    return;
  }
  if (a == b) {
    cout << a << 1 << " " << a << 2 << "\n";
    return;
  }
  if (a == 9 && b == 1) {
    cout << "9 10\n";
    return;
  } else {
    cout << "-1\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
