#include <bits/stdc++.h>
using namespace std;
int a[105], b[105];
int main() {
  int m, s, as = 0, l = 0, ad = 0;
  cin >> m >> s;
  if ((9 * m) < s || (s == 0 && m > 1)) {
    cout << "-1"
         << " -1" << endl;
    return 0;
  }
  if (s <= 9) {
    for (int i = 0; i <= 9; i++) {
      if (0 + i == s) {
        ad = i;
        break;
      }
    }
    a[0] = ad;
    b[0] = ad;
    for (int i = 1; i < m; i++) {
      a[i] = 0;
      b[i] = 0;
    }
    reverse(a, a + m);
    if (a[0] == 0) {
      for (int i = 1; i < m; i++) {
        if (a[i] > 0) {
          a[i] -= 1;
          a[0] = 1;
          break;
        }
      }
    }
    for (int i = 0; i < m; i++) {
      cout << a[i];
    }
    cout << " ";
    for (int i = 0; i < m; i++) {
      cout << b[i];
    }
    cout << endl;
    return 0;
  } else if (s > 9) {
    for (int i = 0; i >= 0; i++) {
      if ((l * 9) + 9 < s) {
        l++;
      } else {
        for (int j = 0; j <= 9; j++) {
          if ((l * 9) + j == s) {
            as = j;
            break;
          }
        }
        break;
      }
    }
    for (int i = 0; i <= l; i++) {
      if (i == l) {
        a[i] = as;
        b[i] = as;
      } else {
        a[i] = 9;
        b[i] = 9;
      }
    }
    for (int i = l + 1; i < m; i++) {
      a[i] = 0;
      b[i] = 0;
    }
    reverse(a, a + m);
    if (a[0] == 0) {
      for (int i = 1; i > 0; i++) {
        if (a[i] > 0) {
          a[i] -= 1;
          a[0] = 1;
          break;
        }
      }
    }
    if (a[m - 1] < 9 && a[m - 2] > 0) {
      a[m - 1] += 1;
      a[m - 2] -= 1;
    }
    for (int i = 0; i < m; i++) {
      cout << a[i];
    }
    cout << " ";
    for (int i = 0; i < m; i++) {
      cout << b[i];
    }
    cout << endl;
    return 0;
  }
  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 a[105], b[105];
int main() {
  int m, s, as = 0, l = 0, ad = 0;
  cin >> m >> s;
  if ((9 * m) < s || (s == 0 && m > 1)) {
    cout << "-1"
         << " -1" << endl;
    return 0;
  }
  if (s <= 9) {
    for (int i = 0; i <= 9; i++) {
      if (0 + i == s) {
        ad = i;
        break;
      }
    }
    a[0] = ad;
    b[0] = ad;
    for (int i = 1; i < m; i++) {
      a[i] = 0;
      b[i] = 0;
    }
    reverse(a, a + m);
    if (a[0] == 0) {
      for (int i = 1; i < m; i++) {
        if (a[i] > 0) {
          a[i] -= 1;
          a[0] = 1;
          break;
        }
      }
    }
    for (int i = 0; i < m; i++) {
      cout << a[i];
    }
    cout << " ";
    for (int i = 0; i < m; i++) {
      cout << b[i];
    }
    cout << endl;
    return 0;
  } else if (s > 9) {
    for (int i = 0; i >= 0; i++) {
      if ((l * 9) + 9 < s) {
        l++;
      } else {
        for (int j = 0; j <= 9; j++) {
          if ((l * 9) + j == s) {
            as = j;
            break;
          }
        }
        break;
      }
    }
    for (int i = 0; i <= l; i++) {
      if (i == l) {
        a[i] = as;
        b[i] = as;
      } else {
        a[i] = 9;
        b[i] = 9;
      }
    }
    for (int i = l + 1; i < m; i++) {
      a[i] = 0;
      b[i] = 0;
    }
    reverse(a, a + m);
    if (a[0] == 0) {
      for (int i = 1; i > 0; i++) {
        if (a[i] > 0) {
          a[i] -= 1;
          a[0] = 1;
          break;
        }
      }
    }
    if (a[m - 1] < 9 && a[m - 2] > 0) {
      a[m - 1] += 1;
      a[m - 2] -= 1;
    }
    for (int i = 0; i < m; i++) {
      cout << a[i];
    }
    cout << " ";
    for (int i = 0; i < m; i++) {
      cout << b[i];
    }
    cout << endl;
    return 0;
  }
  return 0;
}

```