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