#include <bits/stdc++.h>
using namespace std;
long long int modInverse(long long int n, long long int p) {
  long long int x = n;
  long long int y = p - 2;
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int nCrModPFermat(long long int n, long long int r, long long int p) {
  if (r == 0) return 1;
  long long int fac[n + 1];
  fac[0] = 1;
  for (long long int i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % p;
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
long long int fun1(string s, string k, long long int n) {
  long long int i, j;
  long long int a = 0, b = 0, x = 0;
  long long int g[4] = {0};
  long long int p = 1e9 + 7;
  long long int sum = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '1') a++;
    if (k[i] == '1') b++;
  }
  if (a > b) {
    x = 1;
  }
  g[0] = (a - b) * x;
  g[1] = (1 - x) * (b - a);
  g[2] = (n - a) * x + (1 - x) * (n - b);
  g[3] = b * x + (1 - x) * a;
  do {
    sum = (sum + nCrModPFermat(n, g[0] + g[1], p)) % p;
    g[0] += 1;
    g[1] += 1;
    g[2] -= 1;
    g[3] -= 1;
  } while (g[2] >= 0 && g[3] >= 0);
  return sum;
}
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int a, b, ans;
  cin >> a >> b;
  if ((a == 9) && (b == 1)) {
    cout << 9 << " " << 10;
  } else if (a == (b - 1)) {
    cout << a << " " << b;
  } else if (b == a) {
    cout << (a * 10) << " " << (b * 10 + 1);
  } else
    cout << -1;
  return 0;
}
