#include <bits/stdc++.h>
int main() {
  int m, i, s, t, a[1001], b[1001];
  scanf("%d%d", &m, &s);
  if (m == 1 && s == 0)
    printf("0 0\n");
  else if (m * 9 < s || s == 0)
    printf("-1 -1\n");
  else {
    t = s / 9;
    for (i = 0; i < t; i++) {
      a[i] = 9;
    }
    a[t] = s - t * 9;
    for (i = t + 1; i < m; i++) a[i] = 0;
    if (a[m - 1] == 0 && a[t] != 0) {
      b[0] = 1;
      for (i = 1; i <= m - t - 2; i++) b[i] = 0;
      b[m - t - 1] = a[t] - 1;
      for (i = m - t; i < m; i++) {
        b[i] = 9;
      }
      for (i = 0; i < m; i++) printf("%d", b[i]);
      printf(" ");
      for (i = 0; i < m; i++) printf("%d", a[i]);
    } else if (a[m - 1] == 0 && a[t] == 0) {
      b[0] = 1;
      for (i = 1; i <= m - t - 1; i++) b[i] = 0;
      b[m - t] = 8;
      for (i = m - t + 1; i < m; i++) {
        b[i] = 9;
      }
      for (i = 0; i < m; i++) printf("%d", b[i]);
      printf(" ");
      for (i = 0; i < m; i++) printf("%d", a[i]);
    } else {
      for (i = m - 1; i >= 0; i--) printf("%d", a[i]);
      printf(" ");
      for (i = 0; i < m; i++) printf("%d", a[i]);
    }
  }
  return 0;
}

### Prompt

Create a solution in cpp for 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>
int main() {
  int m, i, s, t, a[1001], b[1001];
  scanf("%d%d", &m, &s);
  if (m == 1 && s == 0)
    printf("0 0\n");
  else if (m * 9 < s || s == 0)
    printf("-1 -1\n");
  else {
    t = s / 9;
    for (i = 0; i < t; i++) {
      a[i] = 9;
    }
    a[t] = s - t * 9;
    for (i = t + 1; i < m; i++) a[i] = 0;
    if (a[m - 1] == 0 && a[t] != 0) {
      b[0] = 1;
      for (i = 1; i <= m - t - 2; i++) b[i] = 0;
      b[m - t - 1] = a[t] - 1;
      for (i = m - t; i < m; i++) {
        b[i] = 9;
      }
      for (i = 0; i < m; i++) printf("%d", b[i]);
      printf(" ");
      for (i = 0; i < m; i++) printf("%d", a[i]);
    } else if (a[m - 1] == 0 && a[t] == 0) {
      b[0] = 1;
      for (i = 1; i <= m - t - 1; i++) b[i] = 0;
      b[m - t] = 8;
      for (i = m - t + 1; i < m; i++) {
        b[i] = 9;
      }
      for (i = 0; i < m; i++) printf("%d", b[i]);
      printf(" ");
      for (i = 0; i < m; i++) printf("%d", a[i]);
    } else {
      for (i = m - 1; i >= 0; i--) printf("%d", a[i]);
      printf(" ");
      for (i = 0; i < m; i++) printf("%d", a[i]);
    }
  }
  return 0;
}

```