#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res % p;
}
bool sortBySec(const pair<int, int> &p1, const pair<int, int> &p2) {
  return p1.second > p2.second;
}
bool comp(const pair<int, int> &p1, const pair<int, int> &p2) {
  if (p1.first == p2.first) return p1.second > p2.second;
  return p1.first < p2.first;
}
int GCD(int a, int b) {
  if (a == 0) {
    return b;
  } else if (b == 0) {
    return a;
  } else {
    int z = a % b;
    GCD(b, z);
  }
}
bool isPrime(int n) {
  if (n <= 1) {
    return false;
  } else {
    for (int i = 2; i < n; i++) {
      if (n % i == 0) {
        return false;
      }
    }
    return true;
  }
}
int binaryToDecimal(int n) {
  int num = n;
  int dec_value = 0;
  int base = 1;
  int temp = num;
  while (temp) {
    int last_digit = temp % 10;
    temp = temp / 10;
    dec_value += last_digit * base;
    base = base * 2;
  }
  return dec_value;
}
int primeFactors(int n) {
  vector<long long> a;
  long long cnt = 0;
  while (n % 2 == 0) {
    a.push_back(2);
    n = n / 2;
  }
  for (int i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      a.push_back(i);
      n = n / i;
    }
  }
  if (n > 2) a.push_back(n);
  for (long long i = 0; i < a.size(); i++) {
    if (a[i] == 2) cnt++;
  }
  return cnt;
}
int main() {
  long long m, s, d, l;
  cin >> m >> s;
  l = s;
  string max = "", min = "";
  for (long long i = 0; i < m; i++) {
    if (s >= 9) {
      max += '9';
      s = s - 9;
    } else if (s >= 8) {
      max += '8';
      s -= 8;
    } else if (s >= 7) {
      max += '7';
      s -= 7;
    } else if (s >= 6) {
      max += '6';
      s -= 6;
    } else if (s >= 5) {
      max += '5';
      s -= 5;
    } else if (s >= 4) {
      max += '4';
      s -= 4;
    } else if (s >= 3) {
      max += '3';
      s -= 3;
    } else if (s >= 2) {
      max += '2';
      s -= 2;
    } else if (s >= 1) {
      max += '1';
      s -= 1;
    } else if (s >= 0) {
      max += '0';
      s -= 0;
    }
  }
  d = m - 1;
  s = l;
  for (long long i = 0; i < m; i++) {
    if (s > 9 || (i == m - 1 && s == 9)) {
      min += '9';
      s -= 9;
    } else if (s > 8 || (i == m - 1 && s == 8)) {
      min += '8';
      s -= 8;
    } else if (s > 7 || (i == m - 1 && s == 7)) {
      min += '7';
      s -= 7;
    } else if (s > 6 || (i == m - 1 && s == 6)) {
      min += '6';
      s -= 6;
    } else if (s > 5 || (i == m - 1 && s == 5)) {
      min += '5';
      s -= 5;
    } else if (s > 4 || (i == m - 1 && s == 4)) {
      min += '4';
      s -= 4;
    } else if (s > 3 || (i == m - 1 && s == 3)) {
      min += '3';
      s -= 3;
    } else if (s > 2 || (i == m - 1 && s == 2)) {
      min += '2';
      s -= 2;
    } else if ((i != (m - 1) && s == 1) || (m == 1 && s == 0)) {
      min += '0';
      s -= 0;
    } else if (s >= 1 || (i == m - 1 && s == 1)) {
      min += '1';
      s -= 1;
    }
  }
  reverse(min.begin(), min.end());
  long long summax = 0, summin = 0;
  s = l;
  for (long long i = 0; i < max.length(); i++) {
    int a, b;
    a = max[i] - '0';
    b = min[i] - '0';
    summax += a;
    summin += b;
  }
  if (summax == s && summin == s) {
    if (min[0] == '0' && min.length() != 1)
      cout << "-1" << endl;
    else
      cout << min << " ";
    if (max[0] == '0' && max.length() != 1)
      cout << "-1" << endl;
    else
      cout << max << endl;
  } else {
    cout << "-1 "
         << "-1" << endl;
  }
}

### Prompt

Construct a cpp code solution to the problem outlined:

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 power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res % p;
}
bool sortBySec(const pair<int, int> &p1, const pair<int, int> &p2) {
  return p1.second > p2.second;
}
bool comp(const pair<int, int> &p1, const pair<int, int> &p2) {
  if (p1.first == p2.first) return p1.second > p2.second;
  return p1.first < p2.first;
}
int GCD(int a, int b) {
  if (a == 0) {
    return b;
  } else if (b == 0) {
    return a;
  } else {
    int z = a % b;
    GCD(b, z);
  }
}
bool isPrime(int n) {
  if (n <= 1) {
    return false;
  } else {
    for (int i = 2; i < n; i++) {
      if (n % i == 0) {
        return false;
      }
    }
    return true;
  }
}
int binaryToDecimal(int n) {
  int num = n;
  int dec_value = 0;
  int base = 1;
  int temp = num;
  while (temp) {
    int last_digit = temp % 10;
    temp = temp / 10;
    dec_value += last_digit * base;
    base = base * 2;
  }
  return dec_value;
}
int primeFactors(int n) {
  vector<long long> a;
  long long cnt = 0;
  while (n % 2 == 0) {
    a.push_back(2);
    n = n / 2;
  }
  for (int i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      a.push_back(i);
      n = n / i;
    }
  }
  if (n > 2) a.push_back(n);
  for (long long i = 0; i < a.size(); i++) {
    if (a[i] == 2) cnt++;
  }
  return cnt;
}
int main() {
  long long m, s, d, l;
  cin >> m >> s;
  l = s;
  string max = "", min = "";
  for (long long i = 0; i < m; i++) {
    if (s >= 9) {
      max += '9';
      s = s - 9;
    } else if (s >= 8) {
      max += '8';
      s -= 8;
    } else if (s >= 7) {
      max += '7';
      s -= 7;
    } else if (s >= 6) {
      max += '6';
      s -= 6;
    } else if (s >= 5) {
      max += '5';
      s -= 5;
    } else if (s >= 4) {
      max += '4';
      s -= 4;
    } else if (s >= 3) {
      max += '3';
      s -= 3;
    } else if (s >= 2) {
      max += '2';
      s -= 2;
    } else if (s >= 1) {
      max += '1';
      s -= 1;
    } else if (s >= 0) {
      max += '0';
      s -= 0;
    }
  }
  d = m - 1;
  s = l;
  for (long long i = 0; i < m; i++) {
    if (s > 9 || (i == m - 1 && s == 9)) {
      min += '9';
      s -= 9;
    } else if (s > 8 || (i == m - 1 && s == 8)) {
      min += '8';
      s -= 8;
    } else if (s > 7 || (i == m - 1 && s == 7)) {
      min += '7';
      s -= 7;
    } else if (s > 6 || (i == m - 1 && s == 6)) {
      min += '6';
      s -= 6;
    } else if (s > 5 || (i == m - 1 && s == 5)) {
      min += '5';
      s -= 5;
    } else if (s > 4 || (i == m - 1 && s == 4)) {
      min += '4';
      s -= 4;
    } else if (s > 3 || (i == m - 1 && s == 3)) {
      min += '3';
      s -= 3;
    } else if (s > 2 || (i == m - 1 && s == 2)) {
      min += '2';
      s -= 2;
    } else if ((i != (m - 1) && s == 1) || (m == 1 && s == 0)) {
      min += '0';
      s -= 0;
    } else if (s >= 1 || (i == m - 1 && s == 1)) {
      min += '1';
      s -= 1;
    }
  }
  reverse(min.begin(), min.end());
  long long summax = 0, summin = 0;
  s = l;
  for (long long i = 0; i < max.length(); i++) {
    int a, b;
    a = max[i] - '0';
    b = min[i] - '0';
    summax += a;
    summin += b;
  }
  if (summax == s && summin == s) {
    if (min[0] == '0' && min.length() != 1)
      cout << "-1" << endl;
    else
      cout << min << " ";
    if (max[0] == '0' && max.length() != 1)
      cout << "-1" << endl;
    else
      cout << max << endl;
  } else {
    cout << "-1 "
         << "-1" << endl;
  }
}

```