#include <bits/stdc++.h>
const long long int mod = 1000000007;
const long long int MOD1 = (int)1e9 + 9;
const long double pi = atan2(0, -1);
const int mx = 100001;
const long double eps = 1e-9;
const int N = 2e5 + 5;
const int MAXR = 1000005;
long long int tests = 1;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int l, s;
  cin >> l >> s;
  long long int temp = l;
  long long int temp2 = s;
  if (s == 0) {
    if (l == 1)
      cout << 0 << " " << 0;
    else
      cout << -1 << " " << -1;
  } else if (9 * l < s) {
    cout << -1 << " " << -1;
  } else if (s < l) {
    std::deque<long long int> v;
    l--;
    s--;
    while (s >= 9) {
      v.push_back(9);
      s -= 9;
      l--;
    }
    if (s > 0) {
      v.push_front(s);
      l--;
    }
    while (l--) {
      v.push_front(0);
    }
    v.push_front(1);
    for (auto x : v) cout << x;
    l = temp;
    v.clear();
    s = temp2;
    while (s >= 9) {
      v.push_front(9);
      s -= 9;
      l--;
    }
    cout << " ";
    v.push_back(s);
    l--;
    while (l--) v.push_back(0);
    for (auto x : v) cout << x;
  } else {
    vector<long long int> v;
    for (long long int i = 0; i < l; i++) {
      v.push_back(s / l);
    }
    if (s % l) {
      long long int temp = s % l;
      long long int i = l - 1;
      while (temp > 0 && v[i] <= 9 && i >= 0) {
        v[i]++;
        temp--;
        if (v[i] == 9) {
          i--;
        }
      }
    }
    long long int i = 0;
    long long int j = l - 1;
    while (i < j) {
      if (i == 0) {
        while (v[i] > 1 && v[j] < 9) {
          v[i]--;
          v[j]++;
        }
        if (v[i] == 1) i++;
        if (v[j] == 9) j--;
        continue;
      }
      while (v[i] > 0 && v[j] < 9) {
        v[i]--;
        v[j]++;
      }
      if (v[i] == 0) i++;
      if (v[j] == 9) j--;
    }
    for (auto x : v) cout << x;
    v.clear();
    cout << " ";
    for (long long int i = 0; i < l; i++) {
      v.push_back(s / l);
    }
    if (s % l) {
      long long int temp = s % l;
      long long int i = 0;
      while (temp > 0 && v[i] <= 9 && i <= l - 1) {
        v[i]++;
        temp--;
        if (v[i] == 9) {
          i++;
        }
      }
    }
    i = 0;
    j = l - 1;
    while (i < j) {
      while (v[i] < 9 && v[j] > 0) {
        v[i]++;
        v[j]--;
      }
      if (v[i] == 9) i++;
      if (v[j] == 0) j--;
    }
    for (auto x : v) cout << x;
  }
}

### Prompt

Your challenge is to write a CPP solution 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>
const long long int mod = 1000000007;
const long long int MOD1 = (int)1e9 + 9;
const long double pi = atan2(0, -1);
const int mx = 100001;
const long double eps = 1e-9;
const int N = 2e5 + 5;
const int MAXR = 1000005;
long long int tests = 1;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int l, s;
  cin >> l >> s;
  long long int temp = l;
  long long int temp2 = s;
  if (s == 0) {
    if (l == 1)
      cout << 0 << " " << 0;
    else
      cout << -1 << " " << -1;
  } else if (9 * l < s) {
    cout << -1 << " " << -1;
  } else if (s < l) {
    std::deque<long long int> v;
    l--;
    s--;
    while (s >= 9) {
      v.push_back(9);
      s -= 9;
      l--;
    }
    if (s > 0) {
      v.push_front(s);
      l--;
    }
    while (l--) {
      v.push_front(0);
    }
    v.push_front(1);
    for (auto x : v) cout << x;
    l = temp;
    v.clear();
    s = temp2;
    while (s >= 9) {
      v.push_front(9);
      s -= 9;
      l--;
    }
    cout << " ";
    v.push_back(s);
    l--;
    while (l--) v.push_back(0);
    for (auto x : v) cout << x;
  } else {
    vector<long long int> v;
    for (long long int i = 0; i < l; i++) {
      v.push_back(s / l);
    }
    if (s % l) {
      long long int temp = s % l;
      long long int i = l - 1;
      while (temp > 0 && v[i] <= 9 && i >= 0) {
        v[i]++;
        temp--;
        if (v[i] == 9) {
          i--;
        }
      }
    }
    long long int i = 0;
    long long int j = l - 1;
    while (i < j) {
      if (i == 0) {
        while (v[i] > 1 && v[j] < 9) {
          v[i]--;
          v[j]++;
        }
        if (v[i] == 1) i++;
        if (v[j] == 9) j--;
        continue;
      }
      while (v[i] > 0 && v[j] < 9) {
        v[i]--;
        v[j]++;
      }
      if (v[i] == 0) i++;
      if (v[j] == 9) j--;
    }
    for (auto x : v) cout << x;
    v.clear();
    cout << " ";
    for (long long int i = 0; i < l; i++) {
      v.push_back(s / l);
    }
    if (s % l) {
      long long int temp = s % l;
      long long int i = 0;
      while (temp > 0 && v[i] <= 9 && i <= l - 1) {
        v[i]++;
        temp--;
        if (v[i] == 9) {
          i++;
        }
      }
    }
    i = 0;
    j = l - 1;
    while (i < j) {
      while (v[i] < 9 && v[j] > 0) {
        v[i]++;
        v[j]--;
      }
      if (v[i] == 9) i++;
      if (v[j] == 0) j--;
    }
    for (auto x : v) cout << x;
  }
}

```