#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (m == n)
    cout << m * 10 << " " << n * 10 + 1;
  else if (m - n == 1)
    cout << m * 10 - 1 << " " << m * 10;
  else if (n == 9 && m == 1)
    cout << "999 1000";
  else
    cout << "-1";
  return 0;
}
