#include <bits/stdc++.h>
long long i, j;
using namespace std;
void solve() {
  long long n, k = 0, t = 0, ans = 0, ct = 0, ct2 = 0, sum = 0, temp;
  cin >> n >> sum;
  vector<int> v(n), v2(n);
  if (sum == 0 and n > 1) {
    cout << -1 << " " << -1;
    return;
  }
  if (sum == 0 and n == 1) {
    cout << 0 << " " << 0;
    return;
  }
  v[0] = 1;
  v2[0] = 1;
  for (int i = 1; i < n; i++) {
    v[i] = 0;
    v2[i] = 0;
  }
  i = 0;
  sum--;
  k = sum;
  while (sum > 0) {
    if (i > n - 1) break;
    if (sum > (9 - v[i])) {
      temp = v[i];
      v[i] = 9;
      sum = sum - (9 - temp);
      i++;
    } else if (sum == 9 - v[i]) {
      sum = 0;
      v[i] = 9;
      break;
    } else {
      v[i] += sum;
      sum = 0;
      break;
    }
  }
  i = n - 1;
  while (k > 0) {
    if (i < 0) break;
    if (k >= (9 + v2[i])) {
      k = k - (9 - v2[i]);
      v2[i] = 9;
      i--;
    } else {
      if (v2[i] + k >= 10) break;
      v2[i] += k;
      k = 0;
      break;
    }
  }
  cout << "\n";
  if (k > 0)
    cout << -1;
  else {
    for (auto x : v2) cout << x;
  }
  cout << " ";
  if (sum > 0)
    cout << -1;
  else
    for (auto x : v) cout << x;
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int p = 0;
  { solve(); }
  return 0;
}

### 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>
long long i, j;
using namespace std;
void solve() {
  long long n, k = 0, t = 0, ans = 0, ct = 0, ct2 = 0, sum = 0, temp;
  cin >> n >> sum;
  vector<int> v(n), v2(n);
  if (sum == 0 and n > 1) {
    cout << -1 << " " << -1;
    return;
  }
  if (sum == 0 and n == 1) {
    cout << 0 << " " << 0;
    return;
  }
  v[0] = 1;
  v2[0] = 1;
  for (int i = 1; i < n; i++) {
    v[i] = 0;
    v2[i] = 0;
  }
  i = 0;
  sum--;
  k = sum;
  while (sum > 0) {
    if (i > n - 1) break;
    if (sum > (9 - v[i])) {
      temp = v[i];
      v[i] = 9;
      sum = sum - (9 - temp);
      i++;
    } else if (sum == 9 - v[i]) {
      sum = 0;
      v[i] = 9;
      break;
    } else {
      v[i] += sum;
      sum = 0;
      break;
    }
  }
  i = n - 1;
  while (k > 0) {
    if (i < 0) break;
    if (k >= (9 + v2[i])) {
      k = k - (9 - v2[i]);
      v2[i] = 9;
      i--;
    } else {
      if (v2[i] + k >= 10) break;
      v2[i] += k;
      k = 0;
      break;
    }
  }
  cout << "\n";
  if (k > 0)
    cout << -1;
  else {
    for (auto x : v2) cout << x;
  }
  cout << " ";
  if (sum > 0)
    cout << -1;
  else
    for (auto x : v) cout << x;
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int p = 0;
  { solve(); }
  return 0;
}

```