#include <bits/stdc++.h>
#pragma comment(linker, "/stack:20000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
using namespace std;
int a, b;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> a >> b;
  if (a == 9 && b == 1) {
    cout << 99 << ' ' << 100;
    return 0;
  }
  if (a == b)
    cout << a << 0 << ' ' << b << 1;
  else if (b - a == 1)
    cout << a << 9 << ' ' << b << 0;
  else
    cout << -1;
  return 0;
}
