#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 1, MOD = 1e9 + 7, mod = 998244353, INF = 3e18;
mt19937 Flash_new_51(51515);
using vi = vector<long long>;
using vp = vector<pair<long long, long long>>;
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  long long a, b;
  cin >> a >> b;
  if (b == 1 && a == 9) {
    cout << 9 << ' ' << 10;
    return 0;
  }
  if (abs(a - b) == 0) {
    cout << a * 10 << ' ' << b * 10 + 1;
    return 0;
  }
  if (a < b && a + 1 == b) {
    cout << a << ' ' << b;
    return 0;
  }
  cout << -1;
}
