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