#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  if (n == 9 && m == 1)
    cout << "99 100" << endl;
  else if (m < n || m > n + 1)
    cout << "-1" << endl;
  else {
    if (n == m)
      cout << n << "1"
           << " " << m << "2";
    else
      cout << n << "9"
           << " " << m << "0";
  }
  return 0;
}
