#include <bits/stdc++.h>
using namespace std;
char str1[100 + 10], str2[100 + 10];
int main() {
  int m, s;
  while (~scanf("%d%d", &m, &s)) {
    for (int i = 0; i < m; i++) str1[i] = str2[i] = '0';
    int ss = s;
    if (m == 1 && s == 0) {
      printf("0 0\n");
      continue;
    }
    if (s == 0 || s > m * 9) {
      printf("-1 -1\n");
      continue;
    }
    for (int i = 0; i < m; i++) {
      if (ss > 9) {
        str1[i] = '9';
        ss -= 9;
      } else {
        str1[i] = ss + '0';
        ss -= ss;
      }
    }
    ss = s;
    for (int i = m - 1; i >= 0; i--) {
      if (ss > 9) {
        str2[i] = '9';
        ss -= 9;
      } else {
        if (i == 0) {
          str2[i] = '0' + ss;
          ss -= ss;
        } else {
          str2[i] = '0' + ss - 1;
          ss -= ss - 1;
          str2[0] = '1';
          break;
        }
      }
    }
    str1[m] = str2[m] = '\0';
    printf("%s %s\n", str2, str1);
  }
  return 0;
}

### Prompt

Please provide a cpp coded solution to the problem described below:

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;
char str1[100 + 10], str2[100 + 10];
int main() {
  int m, s;
  while (~scanf("%d%d", &m, &s)) {
    for (int i = 0; i < m; i++) str1[i] = str2[i] = '0';
    int ss = s;
    if (m == 1 && s == 0) {
      printf("0 0\n");
      continue;
    }
    if (s == 0 || s > m * 9) {
      printf("-1 -1\n");
      continue;
    }
    for (int i = 0; i < m; i++) {
      if (ss > 9) {
        str1[i] = '9';
        ss -= 9;
      } else {
        str1[i] = ss + '0';
        ss -= ss;
      }
    }
    ss = s;
    for (int i = m - 1; i >= 0; i--) {
      if (ss > 9) {
        str2[i] = '9';
        ss -= 9;
      } else {
        if (i == 0) {
          str2[i] = '0' + ss;
          ss -= ss;
        } else {
          str2[i] = '0' + ss - 1;
          ss -= ss - 1;
          str2[0] = '1';
          break;
        }
      }
    }
    str1[m] = str2[m] = '\0';
    printf("%s %s\n", str2, str1);
  }
  return 0;
}

```