#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  int m, sum;
  cin >> m >> sum;
  vector<int> digitsMax;
  vector<int> digitsMin;
  if ((sum > 9 && m == 1) || (sum == 0 && m > 1)) {
    cout << -1 << " " << -1 << endl;
    return 0;
  } else if (sum == 0 && m == 1) {
    cout << 0 << " " << 0 << endl;
    return 0;
  } else if (sum <= 9 && m == 1) {
    cout << sum << " " << sum << endl;
    return 0;
  } else if (sum <= 9 && m > 1) {
    digitsMax.push_back(sum);
    for (int i = 0; i < m - 1; i++) {
      digitsMax.push_back(0);
    }
    digitsMin.push_back(1);
    for (int i = 0; i < m - 2; i++) {
      digitsMin.push_back(0);
    }
    digitsMin.push_back(sum - 1);
    for (int i = 0; i < digitsMin.size(); i++) {
      cout << digitsMin[i];
    }
    cout << " ";
    for (int i = 0; i < digitsMax.size(); i++) {
      cout << digitsMax[i];
    }
    return 0;
  } else if (sum > 9 && m >= 1) {
    int storeSum = sum;
    int storeSize = m;
    int storeSecond = m;
    int sumSecond = sum;
    while (storeSum > 0) {
      if (storeSum > 9) {
        digitsMax.push_back(9);
        storeSum -= 9;
      } else {
        digitsMax.push_back(storeSum);
        storeSum = 0;
      }
      m -= 1;
      if (m == 0 && storeSum > 0) {
        cout << -1 << " " << -1 << endl;
        return 0;
      }
    }
    while (m > 0) {
      digitsMax.push_back(0);
      m--;
    }
    m = storeSecond;
    sum = sumSecond;
    for (int i = 0; i < 10000000; i++) {
      if (sum > 9) {
        digitsMin.push_back(9);
        sum -= 9;
        m--;
      } else if (sum > 1 && m > 1) {
        digitsMin.push_back(sum - 1);
        sum = sum - (sum - 1);
        m--;
      }
      if (m == 0 || m == 1) break;
    }
    while (m - 1 > 0) {
      digitsMin.push_back(0);
      m--;
    }
    digitsMin.push_back(sum);
    reverse(digitsMin.begin(), digitsMin.end());
    for (int i = 0; i < digitsMin.size(); i++) {
      cout << digitsMin[i];
    }
    cout << " ";
    for (int i = 0; i < digitsMax.size(); i++) {
      cout << digitsMax[i];
    }
    return 0;
  } else {
    cout << -1 << " " << -1 << 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;
int32_t main() {
  int m, sum;
  cin >> m >> sum;
  vector<int> digitsMax;
  vector<int> digitsMin;
  if ((sum > 9 && m == 1) || (sum == 0 && m > 1)) {
    cout << -1 << " " << -1 << endl;
    return 0;
  } else if (sum == 0 && m == 1) {
    cout << 0 << " " << 0 << endl;
    return 0;
  } else if (sum <= 9 && m == 1) {
    cout << sum << " " << sum << endl;
    return 0;
  } else if (sum <= 9 && m > 1) {
    digitsMax.push_back(sum);
    for (int i = 0; i < m - 1; i++) {
      digitsMax.push_back(0);
    }
    digitsMin.push_back(1);
    for (int i = 0; i < m - 2; i++) {
      digitsMin.push_back(0);
    }
    digitsMin.push_back(sum - 1);
    for (int i = 0; i < digitsMin.size(); i++) {
      cout << digitsMin[i];
    }
    cout << " ";
    for (int i = 0; i < digitsMax.size(); i++) {
      cout << digitsMax[i];
    }
    return 0;
  } else if (sum > 9 && m >= 1) {
    int storeSum = sum;
    int storeSize = m;
    int storeSecond = m;
    int sumSecond = sum;
    while (storeSum > 0) {
      if (storeSum > 9) {
        digitsMax.push_back(9);
        storeSum -= 9;
      } else {
        digitsMax.push_back(storeSum);
        storeSum = 0;
      }
      m -= 1;
      if (m == 0 && storeSum > 0) {
        cout << -1 << " " << -1 << endl;
        return 0;
      }
    }
    while (m > 0) {
      digitsMax.push_back(0);
      m--;
    }
    m = storeSecond;
    sum = sumSecond;
    for (int i = 0; i < 10000000; i++) {
      if (sum > 9) {
        digitsMin.push_back(9);
        sum -= 9;
        m--;
      } else if (sum > 1 && m > 1) {
        digitsMin.push_back(sum - 1);
        sum = sum - (sum - 1);
        m--;
      }
      if (m == 0 || m == 1) break;
    }
    while (m - 1 > 0) {
      digitsMin.push_back(0);
      m--;
    }
    digitsMin.push_back(sum);
    reverse(digitsMin.begin(), digitsMin.end());
    for (int i = 0; i < digitsMin.size(); i++) {
      cout << digitsMin[i];
    }
    cout << " ";
    for (int i = 0; i < digitsMax.size(); i++) {
      cout << digitsMax[i];
    }
    return 0;
  } else {
    cout << -1 << " " << -1 << endl;
    return 0;
  }
}

```