#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long a, b;
  cin >> a >> b;
  if (a == b) {
    cout << a * 10 << " " << a * 10 + 1 << endl;
  } else if (a + 1 == b) {
    cout << a * 10 + 9 << " " << b * 10 << endl;
  } else if (a == 9 && b == 1) {
    cout << a << " " << a + 1 << endl;
  } else {
    cout << -1 << endl;
  }
}
void testcase() {
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
