#include <bits/stdc++.h>
long long mod = 1000000007;
const long long AM = 2e5 + 5;
using namespace std;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t;
  t = 1;
  while (t--) {
    long long m, second;
    cin >> m >> second;
    if (second > m * 9 || (second == 0 && m > 1))
      cout << "-1 -1" << '\n';
    else if (m == 1 && second == 0)
      cout << "0 0" << '\n';
    else {
      string min = "1";
      string ans = "";
      long long sum = second;
      int flag = 0;
      for (__typeof(0) i = 0; i < m; ++i) {
        for (__typeof(9) d = 9; d > -1; d--) {
          if (sum >= d) {
            ans += char('0' + d);
            sum -= d;
            if (d == 0) flag = 1;
            break;
          }
        }
      }
      if (flag) {
        string temp = "";
        long long minS = second - 1;
        for (__typeof(0) i = 0; i < m - 1; ++i) {
          for (__typeof(9) d = 9; d > -1; d--) {
            if (minS >= d) {
              temp += char('0' + d);
              minS -= d;
              break;
            }
          }
        }
        reverse(temp.begin(), temp.end());
        min += temp;
      }
      if (flag) {
        cout << min << " " << ans << '\n';
      } else {
        string MAX = ans;
        reverse(ans.begin(), ans.end());
        cout << ans << " " << MAX << '\n';
      }
    }
  }
}

### 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>
long long mod = 1000000007;
const long long AM = 2e5 + 5;
using namespace std;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t;
  t = 1;
  while (t--) {
    long long m, second;
    cin >> m >> second;
    if (second > m * 9 || (second == 0 && m > 1))
      cout << "-1 -1" << '\n';
    else if (m == 1 && second == 0)
      cout << "0 0" << '\n';
    else {
      string min = "1";
      string ans = "";
      long long sum = second;
      int flag = 0;
      for (__typeof(0) i = 0; i < m; ++i) {
        for (__typeof(9) d = 9; d > -1; d--) {
          if (sum >= d) {
            ans += char('0' + d);
            sum -= d;
            if (d == 0) flag = 1;
            break;
          }
        }
      }
      if (flag) {
        string temp = "";
        long long minS = second - 1;
        for (__typeof(0) i = 0; i < m - 1; ++i) {
          for (__typeof(9) d = 9; d > -1; d--) {
            if (minS >= d) {
              temp += char('0' + d);
              minS -= d;
              break;
            }
          }
        }
        reverse(temp.begin(), temp.end());
        min += temp;
      }
      if (flag) {
        cout << min << " " << ans << '\n';
      } else {
        string MAX = ans;
        reverse(ans.begin(), ans.end());
        cout << ans << " " << MAX << '\n';
      }
    }
  }
}

```