#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  if (b - a == 1)
    cout << a * 10 + 9 << " " << b * 10;
  else if (b == a)
    cout << a * 10 << " " << a * 10 + 1;
  else if (a == 9 && b == 1)
    cout << 99 << " " << 100;
  else
    cout << -1;
}
