#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int lm1, lm2;
  scanf("%d %d", &lm1, &lm2);
  if (lm1 == lm2) {
    printf("%d %d", lm1 * 10 + 1, lm2 * 10 + 2);
  } else if (lm1 < lm2) {
    if (lm2 - lm1 == 1)
      printf("%d %d", lm1 * 10 + 9, lm2 * 10);
    else
      printf("-1");
  } else {
    if (lm1 == 9 && lm2 == 1)
      printf("9 10");
    else
      printf("-1");
  }
  return 0;
}
