#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int b) {
  long long int res = 1;
  a %= 1000000007;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
long long int modInverse(long long int a) { return power(a, 1000000007 - 2); }
const int N = 500023;
bool compare(long long int x, long long int y) { return x > y; }
bool can(long long int n, long long int sum) {
  if (sum <= 9 * n && sum >= 0) {
    return true;
  } else {
    return false;
  }
}
void solve() {
  long long int m, s;
  string max, min;
  cin >> m >> s;
  long long int sum = s;
  if (!s) {
    if (m > 1) {
      cout << "-1 -1";
      cout << "\n";
      return;
    } else {
      cout << 0 << " " << 0;
      cout << "\n";
      return;
    }
  }
  if (!can(m, s)) {
    cout << "-1 -1";
    cout << "\n";
    return;
  }
  for (long long int i = 0; i < m; i++) {
    for (long long int j = 9; j >= 0; j--) {
      if (can(m - i - 1, s - j)) {
        max += (to_string(j));
        s -= j;
        break;
      }
    }
  }
  for (long long int i = 0; i < m; i++) {
    if (i == 0) {
      for (long long int j = 1; j < 10; j++) {
        if (can(m - i - 1, sum - j)) {
          min += (to_string(j));
          sum -= j;
          break;
        } else {
        }
      }
    } else {
      for (long long int j = 0; j < 10; j++) {
        if (can(m - i - 1, sum - j)) {
          min += (to_string(j));
          sum -= j;
          break;
        }
      }
    }
  }
  cout << min << " " << max;
  cout << "\n";
  return;
}
int main() {
  {
    ios ::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  };
  int T = 1;
  int t = 0;
  while (t++ < T) {
    solve();
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
}

### Prompt

Please provide a CPP coded solution to the problem described below:

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;
long long int power(long long int a, long long int b) {
  long long int res = 1;
  a %= 1000000007;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
long long int modInverse(long long int a) { return power(a, 1000000007 - 2); }
const int N = 500023;
bool compare(long long int x, long long int y) { return x > y; }
bool can(long long int n, long long int sum) {
  if (sum <= 9 * n && sum >= 0) {
    return true;
  } else {
    return false;
  }
}
void solve() {
  long long int m, s;
  string max, min;
  cin >> m >> s;
  long long int sum = s;
  if (!s) {
    if (m > 1) {
      cout << "-1 -1";
      cout << "\n";
      return;
    } else {
      cout << 0 << " " << 0;
      cout << "\n";
      return;
    }
  }
  if (!can(m, s)) {
    cout << "-1 -1";
    cout << "\n";
    return;
  }
  for (long long int i = 0; i < m; i++) {
    for (long long int j = 9; j >= 0; j--) {
      if (can(m - i - 1, s - j)) {
        max += (to_string(j));
        s -= j;
        break;
      }
    }
  }
  for (long long int i = 0; i < m; i++) {
    if (i == 0) {
      for (long long int j = 1; j < 10; j++) {
        if (can(m - i - 1, sum - j)) {
          min += (to_string(j));
          sum -= j;
          break;
        } else {
        }
      }
    } else {
      for (long long int j = 0; j < 10; j++) {
        if (can(m - i - 1, sum - j)) {
          min += (to_string(j));
          sum -= j;
          break;
        }
      }
    }
  }
  cout << min << " " << max;
  cout << "\n";
  return;
}
int main() {
  {
    ios ::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  };
  int T = 1;
  int t = 0;
  while (t++ < T) {
    solve();
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
}

```