#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (m == 0) {
    if (n == 1)
      return printf("0 0\n"), 0;
    else
      return printf("-1 -1\n"), 0;
  }
  if (m > 9 * n) return printf("-1 -1\n"), 0;
  int mm = m;
  string ans;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 10; j++) {
      if (!i && !j) continue;
      int t = mm - j;
      if (0 <= t && t <= (n - i - 1) * 9) {
        ans = ans + (char)('0' + j);
        mm = t;
        break;
      }
    }
  }
  string res;
  for (int i = 0; i < n; i++) {
    for (int j = 9; j >= 0; j--) {
      if (!i && !j) continue;
      int t = m - j;
      if (0 <= t && t <= (n - i - 1) * 9) {
        res = res + (char)('0' + j);
        m = t;
        break;
      }
    }
  }
  cout << ans << " " << res << endl;
  return 0;
}

### Prompt

Please formulate 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;
int main() {
  int n, m;
  cin >> n >> m;
  if (m == 0) {
    if (n == 1)
      return printf("0 0\n"), 0;
    else
      return printf("-1 -1\n"), 0;
  }
  if (m > 9 * n) return printf("-1 -1\n"), 0;
  int mm = m;
  string ans;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 10; j++) {
      if (!i && !j) continue;
      int t = mm - j;
      if (0 <= t && t <= (n - i - 1) * 9) {
        ans = ans + (char)('0' + j);
        mm = t;
        break;
      }
    }
  }
  string res;
  for (int i = 0; i < n; i++) {
    for (int j = 9; j >= 0; j--) {
      if (!i && !j) continue;
      int t = m - j;
      if (0 <= t && t <= (n - i - 1) * 9) {
        res = res + (char)('0' + j);
        m = t;
        break;
      }
    }
  }
  cout << ans << " " << res << endl;
  return 0;
}

```