#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long quickmod(long long a, long long n) {
  long long s = 1;
  while (n) {
    if (n & 1) {
      s = s * a % mod;
    }
    a = (a * a) % mod;
    n = n / 2;
  }
  return s;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
bool isPrime(long long x) {
  if (x <= 1) return false;
  if (x == 2) return true;
  if (x % 2 == 0) return false;
  long long i, m;
  m = sqrt(x);
  for (i = 2; i <= m; i++) {
    if (x % i == 0) return false;
  }
  return true;
}
const int N = 1e5 + 5;
int t;
int a, b;
int main() {
  while (cin >> a >> b) {
    int t = a - b;
    if (!t)
      cout << a * 10 << " " << b * 10 + 1 << endl;
    else if (t == -1)
      cout << a << " " << b << endl;
    else if (t == 8)
      cout << a << " " << b * 10 << endl;
    else
      cout << "-1" << endl;
  }
  return 0;
}
