#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 4;
const long long M = 1e6 + 9;
const long long INF = 1e9 + 7;
const int SM = 1e3 + 5;
const double EPS = 3e-16;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int a, b;
  cin >> a >> b;
  if (a == b) {
    cout << a * 10 << " " << b * 10 + 1;
  } else {
    if (a == 9 && b == 1) return cout << "99 100", 0;
    if (a > b || b - a > 1) {
      cout << "-1";
    } else {
      cout << a << ' ' << b;
    }
  }
  return 0;
}
