#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int a, b;
  cin >> a >> b;
  bool solve = false;
  for (int i = 1; i < 100; ++i) {
    for (int j = i; j < 100; ++j) {
      string s = to_string(i);
      string t = to_string(j);
      if (s[0] == a + '0' && t[0] == b + '0' && i + 1 == j) {
        cout << i << ' ' << j << endl;
        solve = true;
        break;
      }
    }
    if (solve) break;
  }
  if (!solve) cout << -1;
}
