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