#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int x, y;
  cin >> x >> y;
  if (x + 1 == y)
    cout << x << " " << y;
  else if (x == y)
    cout << x << "0"
         << " " << y << "1";
  else if (x == 9 and y == 1)
    cout << 9 << " " << 10;
  else
    cout << -1;
  return 0;
}
