#include <bits/stdc++.h>
using namespace std;
int small(int m, int s);
int lar(int m, int s) {
  int l = 0, i;
  vector<long long int> v;
  while (s / 10 != 0) {
    v.push_back(9);
    s = s - 9;
    l++;
  }
  v.push_back(s);
  l++;
  for (i = l + 1; i <= m; i++) v.push_back(0);
  for (i = 0; i < v.size(); i++) {
    cout << v[i];
  }
  return 0;
}
int small(int m, int s) {
  vector<long long int> x;
  if ((s - 1) > (m - 1) * 9 && (m - 1) > 0) {
    x.push_back(s - (m - 1) * 9);
    s = (m - 1) * 9;
    m--;
  } else if (m == 1 && s <= 9) {
    x.push_back(s);
    s = 0;
    m--;
  } else {
    x.push_back(1);
    s--;
    m--;
  }
  while (m > s / 9 && ((m - 1) > 0 || s == 0)) {
    x.push_back(0);
    m--;
    if (m * 9 < s) {
      x.pop_back();
      break;
    }
  }
  while (s > 9) {
    x.push_back(s - (ceil((float)s / 9) - 1) * 9);
    s = (ceil((float)s / 9) - 1) * 9;
    m--;
  }
  if (s) x.push_back(s);
  for (int i = 0; i < x.size(); i++) cout << x[i];
  return 0;
}
int main() {
  int m, s;
  cin >> m;
  cin >> s;
  if (m == 0 || (s == 0 && m > 1) || (s > m * 9)) {
    cout << "-1 -1";
    return 0;
  }
  if (s == 0 && m == 1) {
    cout << "0 0";
    return 0;
  }
  small(m, s);
  cout << " ";
  lar(m, s);
  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 small(int m, int s);
int lar(int m, int s) {
  int l = 0, i;
  vector<long long int> v;
  while (s / 10 != 0) {
    v.push_back(9);
    s = s - 9;
    l++;
  }
  v.push_back(s);
  l++;
  for (i = l + 1; i <= m; i++) v.push_back(0);
  for (i = 0; i < v.size(); i++) {
    cout << v[i];
  }
  return 0;
}
int small(int m, int s) {
  vector<long long int> x;
  if ((s - 1) > (m - 1) * 9 && (m - 1) > 0) {
    x.push_back(s - (m - 1) * 9);
    s = (m - 1) * 9;
    m--;
  } else if (m == 1 && s <= 9) {
    x.push_back(s);
    s = 0;
    m--;
  } else {
    x.push_back(1);
    s--;
    m--;
  }
  while (m > s / 9 && ((m - 1) > 0 || s == 0)) {
    x.push_back(0);
    m--;
    if (m * 9 < s) {
      x.pop_back();
      break;
    }
  }
  while (s > 9) {
    x.push_back(s - (ceil((float)s / 9) - 1) * 9);
    s = (ceil((float)s / 9) - 1) * 9;
    m--;
  }
  if (s) x.push_back(s);
  for (int i = 0; i < x.size(); i++) cout << x[i];
  return 0;
}
int main() {
  int m, s;
  cin >> m;
  cin >> s;
  if (m == 0 || (s == 0 && m > 1) || (s > m * 9)) {
    cout << "-1 -1";
    return 0;
  }
  if (s == 0 && m == 1) {
    cout << "0 0";
    return 0;
  }
  small(m, s);
  cout << " ";
  lar(m, s);
  return 0;
}

```