#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 47, MAXN = 2e5 + 47;
struct Point {
  double x, y;
  Point(double a = 0, double b = 0) {
    x = a;
    y = b;
  }
  double dist() { return sqrt(x * x + y * y); }
  double angle() { return atan2(y, x); }
};
struct Vector {
  double x, y;
  Vector(double a = 0, double b = 0) {
    x = a;
    y = b;
  }
  Vector(const Point& A, const Point& B) {
    x = B.x - A.x;
    y = B.y - A.y;
  }
  double dist() { return sqrt(x * x + y * y); }
};
Vector operator+(const Vector& a, const Vector& b) {
  return Vector(a.x + b.x, a.y + b.y);
}
Point operator+(const Point& a, const Vector& b) {
  return Point(a.x + b.x, a.y + b.y);
}
Vector operator-(const Vector& a, const Vector& b) {
  return Vector(a.x - b.x, a.y - b.y);
}
Vector operator*(const Vector& a, double k) { return Vector(a.x * k, a.y * k); }
Vector operator/(const Vector& a, double k) { return Vector(a.x / k, a.y / k); }
istream& operator>>(istream& in, Point& P) {
  in >> P.x >> P.y;
  return in;
}
ostream& operator<<(ostream& out, const Point& P) {
  out << P.x << " " << P.y;
  return out;
}
istream& operator>>(istream& in, Vector& P) {
  in >> P.x >> P.y;
  return in;
}
ostream& operator<<(ostream& out, const Vector& P) {
  out << P.x << " " << P.y;
  return out;
}
istream& operator>>(istream& in, vector<long long>& a) {
  for (auto& i : a) cin >> i;
  return in;
}
ostream& operator<<(ostream& out, vector<long long>& a) {
  for (auto& i : a) cout << i << " ";
  return out;
}
double degrees(double radians) { return radians / M_PI * 180; }
signed main() {
  setlocale(LC_ALL, "rus");
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long d1, d2;
  cin >> d1 >> d2;
  if (d1 == 9 && d2 == 1) {
    cout << "9 10";
    return 0;
  }
  if (abs(d1 - d2) > 1) {
    cout << -1;
    return 0;
  } else {
    if (d1 == 0 && abs(d1 - d2) == 0) {
      cout << -1;
      return 0;
    }
    if (d1 == 0 && d2 == 1) {
      cout << "0 1";
      return 0;
    }
    if (abs(d1 - d2) == 0)
      cout << d1 << "00 " << d2 << "01";
    else if (abs(d1 - d2) == 1) {
      if (d2 - d1 < 0)
        cout << -1;
      else
        cout << d1 << "99 " << d2 << "00";
    }
  }
}
