#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  int a, b;
  cin >> a >> b;
  if (b - a == 1) {
    cout << a << " " << b << "\n";
    return 0;
  }
  if (a == b) {
    cout << a * 10 << " " << b * 10 + 1 << "\n";
    return 0;
  }
  if (a == 9 && b == 1) {
    cout << a << " " << b * 10 << "\n";
    return 0;
  }
  cout << -1 << "\n";
  return 0;
}
