#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (m >= 10 && n == 1 || m == 0 && n > 1) {
    cout << "-1"
         << " "
         << "-1" << endl;
    return 0;
  }
  string first = "";
  string second = "";
  int x = n;
  while (x && m >= 9) {
    m -= 9;
    first += "9";
    x--;
  }
  if (x == 0 && m > 0) {
    cout << "-1"
         << " "
         << "-1" << endl;
    return 0;
  } else if (x > 0) {
    first += ('0' + m);
    x--;
  }
  while (x > 0) {
    first += "0";
    x--;
  }
  char xx;
  int is = 0;
  int i = 0;
  for (i = first.size() - 1; i >= 0; i--) {
    if (first[i] == '0') {
      second += "0";
    } else if (first[i] != '0' && is == 0) {
      second = first[i] + second;
      is = 1;
    } else {
      second += first[i];
    }
  }
  for (int i = second.length() - 1; i >= 0; i--) {
    if (second[i] == '0') {
      int number = second[0] - '0';
      number--;
      second[i] = number + '0';
      second[0] = '1';
    }
  }
  if (is != 1) {
    for (int i = first.size() - 1; i >= 0; i--) cout << first[i];
  } else
    cout << second;
  cout << " " << first << endl;
}

### 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>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (m >= 10 && n == 1 || m == 0 && n > 1) {
    cout << "-1"
         << " "
         << "-1" << endl;
    return 0;
  }
  string first = "";
  string second = "";
  int x = n;
  while (x && m >= 9) {
    m -= 9;
    first += "9";
    x--;
  }
  if (x == 0 && m > 0) {
    cout << "-1"
         << " "
         << "-1" << endl;
    return 0;
  } else if (x > 0) {
    first += ('0' + m);
    x--;
  }
  while (x > 0) {
    first += "0";
    x--;
  }
  char xx;
  int is = 0;
  int i = 0;
  for (i = first.size() - 1; i >= 0; i--) {
    if (first[i] == '0') {
      second += "0";
    } else if (first[i] != '0' && is == 0) {
      second = first[i] + second;
      is = 1;
    } else {
      second += first[i];
    }
  }
  for (int i = second.length() - 1; i >= 0; i--) {
    if (second[i] == '0') {
      int number = second[0] - '0';
      number--;
      second[i] = number + '0';
      second[0] = '1';
    }
  }
  if (is != 1) {
    for (int i = first.size() - 1; i >= 0; i--) cout << first[i];
  } else
    cout << second;
  cout << " " << first << endl;
}

```