#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000009;
const long long INFLL = (long long)INF * (long long)INF;
const long double EPS = 10e-9;
template <typename T>
long long ceil_me(T x) {
  double y = x - (long long)x;
  if (y < EPS)
    return (long long)x;
  else
    return (long long)x + 1;
}
template <typename T>
long long floor_me(T x) {
  return (long long)x;
}
long long modu(long long x, long long n) {
  if (x < 0) {
    long long t = -1 * x;
    long long q = t / n;
    q++;
    return (n * q + x);
  } else {
    return x % n;
  }
}
void solve() {
  long long m, s;
  cin >> m >> s;
  if (9 * m < s) {
    cout << "-1 -1"
         << "\n";
    return;
  }
  if (9 * m == s) {
    for (long long i = 0; i < m; i++) cout << 9;
    cout << " ";
    for (long long i = 0; i < m; i++) cout << 9;
    cout << "\n";
    return;
  }
  if (s == 0 && m != 1) {
    cout << "-1 -1"
         << "\n";
    return;
  }
  if (s == 0 && m == 1) {
    cout << 0 << " " << 0 << "\n";
    return;
  }
  vector<long long> arr(m);
  long long q = s / 9;
  long long r = s % 9;
  for (long long i = 0; i < q; i++) arr[i] = 9;
  arr[q] = r;
  for (long long i = q + 1; i < m; i++) arr[i] = 0;
  long long last = (r == 0 ? (q - 1) : q);
  vector<long long> min = arr;
  min[last] -= 1;
  min[m - 1] += 1;
  for (long long i = m - 1; i >= 0; i--) cout << min[i];
  cout << " ";
  for (long long i = 0; i < m; i++) cout << arr[i];
  cout << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}

### Prompt

Generate a cpp solution to the following problem:

You have a positive integer m and a non-negative integer s. Your task is to find the smallest and the largest of the numbers that have length m and sum of digits s. The required numbers should be non-negative integers written in the decimal base without leading zeroes.

Input

The single line of the input contains a pair of integers m, s (1 ≤ m ≤ 100, 0 ≤ s ≤ 900) — the length and the sum of the digits of the required numbers.

Output

In the output print the pair of the required non-negative integer numbers — first the minimum possible number, then — the maximum possible number. If no numbers satisfying conditions required exist, print the pair of numbers "-1 -1" (without the quotes).

Examples

Input

2 15


Output

69 96


Input

3 0


Output

-1 -1

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000009;
const long long INFLL = (long long)INF * (long long)INF;
const long double EPS = 10e-9;
template <typename T>
long long ceil_me(T x) {
  double y = x - (long long)x;
  if (y < EPS)
    return (long long)x;
  else
    return (long long)x + 1;
}
template <typename T>
long long floor_me(T x) {
  return (long long)x;
}
long long modu(long long x, long long n) {
  if (x < 0) {
    long long t = -1 * x;
    long long q = t / n;
    q++;
    return (n * q + x);
  } else {
    return x % n;
  }
}
void solve() {
  long long m, s;
  cin >> m >> s;
  if (9 * m < s) {
    cout << "-1 -1"
         << "\n";
    return;
  }
  if (9 * m == s) {
    for (long long i = 0; i < m; i++) cout << 9;
    cout << " ";
    for (long long i = 0; i < m; i++) cout << 9;
    cout << "\n";
    return;
  }
  if (s == 0 && m != 1) {
    cout << "-1 -1"
         << "\n";
    return;
  }
  if (s == 0 && m == 1) {
    cout << 0 << " " << 0 << "\n";
    return;
  }
  vector<long long> arr(m);
  long long q = s / 9;
  long long r = s % 9;
  for (long long i = 0; i < q; i++) arr[i] = 9;
  arr[q] = r;
  for (long long i = q + 1; i < m; i++) arr[i] = 0;
  long long last = (r == 0 ? (q - 1) : q);
  vector<long long> min = arr;
  min[last] -= 1;
  min[m - 1] += 1;
  for (long long i = m - 1; i >= 0; i--) cout << min[i];
  cout << " ";
  for (long long i = 0; i < m; i++) cout << arr[i];
  cout << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}

```