#include <bits/stdc++.h>
using namespace std;
long long a, b;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  cin >> a >> b;
  if (a + 1 == b)
    cout << a << "9 " << b << "0"
         << "\n";
  else if (a == b)
    cout << a << "1 " << b << "2"
         << "\n";
  else if (a == 9 && b == 1)
    cout << "9 10"
         << "\n";
  else
    cout << -1 << "\n";
}
