#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int no_of_digits, sum, i;
  cin >> no_of_digits >> sum;
  long long int sum1 = sum;
  vector<long long int> min(no_of_digits);
  vector<long long int> max(no_of_digits);
  if (sum > 9 * no_of_digits || sum < 0) {
    cout << -1 << " " << -1;
  } else if (sum == 0 && no_of_digits > 1) {
    cout << -1 << " " << -1;
  } else if (sum >= 0 && sum <= 9) {
    if (no_of_digits == 1) {
      { cout << sum << " " << sum << endl; }
    } else {
      for (i = 1; i < no_of_digits - 1; i++) {
        min[i] = 0;
      }
      min[0] = 1;
      min[no_of_digits - 1] = sum - 1;
      for (i = 1; i < no_of_digits; i++) {
        max[i] = 0;
      }
      max[0] = sum1;
      for (i = 0; i < no_of_digits; i++) {
        cout << min[i];
      }
      cout << " ";
      for (i = 0; i < no_of_digits; i++) {
        cout << max[i];
      }
    }
  } else {
    if (9 * (no_of_digits - 1) >= sum) {
      min[0] = 1;
    } else {
      min[0] = sum - 9 * (no_of_digits - 1);
    }
    sum = sum - min[0];
    for (i = no_of_digits - 1; i > 0; i--) {
      if (sum > 9) {
        min[i] = 9;
        sum -= 9;
      } else {
        min[i] = sum;
        sum = 0;
      }
    }
    max[0] = 9;
    sum1 -= 9;
    for (i = 1; i < no_of_digits; i++) {
      if (sum1 > 9) {
        max[i] = 9;
        sum1 -= 9;
      } else {
        max[i] = sum1;
        sum1 = 0;
      }
    }
    for (i = 0; i < no_of_digits; i++) {
      cout << min[i];
    }
    cout << " ";
    for (i = 0; i < no_of_digits; i++) {
      cout << max[i];
    }
  }
}

### Prompt

Please create a solution in CPP 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 main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int no_of_digits, sum, i;
  cin >> no_of_digits >> sum;
  long long int sum1 = sum;
  vector<long long int> min(no_of_digits);
  vector<long long int> max(no_of_digits);
  if (sum > 9 * no_of_digits || sum < 0) {
    cout << -1 << " " << -1;
  } else if (sum == 0 && no_of_digits > 1) {
    cout << -1 << " " << -1;
  } else if (sum >= 0 && sum <= 9) {
    if (no_of_digits == 1) {
      { cout << sum << " " << sum << endl; }
    } else {
      for (i = 1; i < no_of_digits - 1; i++) {
        min[i] = 0;
      }
      min[0] = 1;
      min[no_of_digits - 1] = sum - 1;
      for (i = 1; i < no_of_digits; i++) {
        max[i] = 0;
      }
      max[0] = sum1;
      for (i = 0; i < no_of_digits; i++) {
        cout << min[i];
      }
      cout << " ";
      for (i = 0; i < no_of_digits; i++) {
        cout << max[i];
      }
    }
  } else {
    if (9 * (no_of_digits - 1) >= sum) {
      min[0] = 1;
    } else {
      min[0] = sum - 9 * (no_of_digits - 1);
    }
    sum = sum - min[0];
    for (i = no_of_digits - 1; i > 0; i--) {
      if (sum > 9) {
        min[i] = 9;
        sum -= 9;
      } else {
        min[i] = sum;
        sum = 0;
      }
    }
    max[0] = 9;
    sum1 -= 9;
    for (i = 1; i < no_of_digits; i++) {
      if (sum1 > 9) {
        max[i] = 9;
        sum1 -= 9;
      } else {
        max[i] = sum1;
        sum1 = 0;
      }
    }
    for (i = 0; i < no_of_digits; i++) {
      cout << min[i];
    }
    cout << " ";
    for (i = 0; i < no_of_digits; i++) {
      cout << max[i];
    }
  }
}

```