#include <bits/stdc++.h>
using namespace std;
using lint = long long;
vector<vector<bool>> dp;
vector<string> result(2);
int n, sum;
int get(int idx, int sum, int maximum, int done = 1) {
  if (idx == 0) return (sum ? 0 : 1);
  if (done) return dp[idx][sum];
  int works = 0;
  int cur;
  if (maximum)
    cur = INT_MIN;
  else
    cur = INT_MAX;
  for (int i = 0; i <= 9; ++i) {
    if (sum - i >= 0)
      if (idx != n || i) {
        works |= get(idx - 1, sum - i, -1);
        if (works) {
          if (maximum)
            cur = max(cur, i);
          else
            cur = min(cur, i);
        }
      }
  }
  if (maximum == 1) {
    result[maximum].push_back(cur + '0');
    return get(idx - 1, sum - cur, 1, 0);
  } else if (maximum == 0) {
    result[maximum].push_back(cur + '0');
    return get(idx - 1, sum - cur, 0, 0);
  }
  return dp[idx][sum] = works;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> sum;
  dp = vector<vector<bool>>(n + 1, vector<bool>(sum + 1, false));
  if (n == 1 && sum == 0) {
    cout << "0 0\n";
    exit(0);
  }
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j <= sum; ++j) {
      get(i, j, -1, 0);
    }
  }
  if (get(n, sum, -1) == 0) {
    cout << "-1 -1\n";
    exit(0);
  }
  get(n, sum, 1, 0);
  get(n, sum, 0, 0);
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < result[i].size(); ++j) cout << result[i][j];
    if (i == 0)
      cout << ' ';
    else
      cout << '\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>
using namespace std;
using lint = long long;
vector<vector<bool>> dp;
vector<string> result(2);
int n, sum;
int get(int idx, int sum, int maximum, int done = 1) {
  if (idx == 0) return (sum ? 0 : 1);
  if (done) return dp[idx][sum];
  int works = 0;
  int cur;
  if (maximum)
    cur = INT_MIN;
  else
    cur = INT_MAX;
  for (int i = 0; i <= 9; ++i) {
    if (sum - i >= 0)
      if (idx != n || i) {
        works |= get(idx - 1, sum - i, -1);
        if (works) {
          if (maximum)
            cur = max(cur, i);
          else
            cur = min(cur, i);
        }
      }
  }
  if (maximum == 1) {
    result[maximum].push_back(cur + '0');
    return get(idx - 1, sum - cur, 1, 0);
  } else if (maximum == 0) {
    result[maximum].push_back(cur + '0');
    return get(idx - 1, sum - cur, 0, 0);
  }
  return dp[idx][sum] = works;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> sum;
  dp = vector<vector<bool>>(n + 1, vector<bool>(sum + 1, false));
  if (n == 1 && sum == 0) {
    cout << "0 0\n";
    exit(0);
  }
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j <= sum; ++j) {
      get(i, j, -1, 0);
    }
  }
  if (get(n, sum, -1) == 0) {
    cout << "-1 -1\n";
    exit(0);
  }
  get(n, sum, 1, 0);
  get(n, sum, 0, 0);
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < result[i].size(); ++j) cout << result[i][j];
    if (i == 0)
      cout << ' ';
    else
      cout << '\n';
  }
}

```