#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long power(long long a, long long b, long long n) {
  long long ans = 1;
  a = a % n;
  while (b > 1) {
    if (b & 1) ans = (ans * a) % n;
    a = (a * a) % n;
    b >>= 1;
  }
  return ans;
}
int main() {
  int m, sum;
  cin >> m >> sum;
  if (sum == 0) {
    if (m == 1)
      cout << "0 0\n";
    else
      cout << "-1 -1\n";
    return 0;
  }
  string str(m, '9');
  long long s = 1;
  s = m * 9;
  if (sum > s) {
    cout << "-1 -1\n";
    return 0;
  }
  long long l = s;
  string sml = str;
  s -= sum;
  l -= sum;
  if (l <= 8) {
    sml[0] = (9 - s) + 48;
    cout << sml << " ";
  } else {
    sml[0] = '1';
    l -= 8;
    for (int i = 1; i < m && l > 0; i++) {
      if (l >= 9) {
        sml[i] = '0';
        l -= 9;
      } else {
        sml[i] = (9 - l) + 48;
        l = 0;
      }
    }
    cout << sml << " ";
  }
  for (int i = m - 1; i >= 0 && s > 0; i--) {
    if (s >= 9) {
      str[i] = '0';
      s -= 9;
    } else {
      int x = 9 - s;
      s = 0;
      str[i] = x + 48;
    }
  }
  cout << str << "\n";
}

### Prompt

In cpp, your task is to solve 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;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long power(long long a, long long b, long long n) {
  long long ans = 1;
  a = a % n;
  while (b > 1) {
    if (b & 1) ans = (ans * a) % n;
    a = (a * a) % n;
    b >>= 1;
  }
  return ans;
}
int main() {
  int m, sum;
  cin >> m >> sum;
  if (sum == 0) {
    if (m == 1)
      cout << "0 0\n";
    else
      cout << "-1 -1\n";
    return 0;
  }
  string str(m, '9');
  long long s = 1;
  s = m * 9;
  if (sum > s) {
    cout << "-1 -1\n";
    return 0;
  }
  long long l = s;
  string sml = str;
  s -= sum;
  l -= sum;
  if (l <= 8) {
    sml[0] = (9 - s) + 48;
    cout << sml << " ";
  } else {
    sml[0] = '1';
    l -= 8;
    for (int i = 1; i < m && l > 0; i++) {
      if (l >= 9) {
        sml[i] = '0';
        l -= 9;
      } else {
        sml[i] = (9 - l) + 48;
        l = 0;
      }
    }
    cout << sml << " ";
  }
  for (int i = m - 1; i >= 0 && s > 0; i--) {
    if (s >= 9) {
      str[i] = '0';
      s -= 9;
    } else {
      int x = 9 - s;
      s = 0;
      str[i] = x + 48;
    }
  }
  cout << str << "\n";
}

```