#include <bits/stdc++.h>
#pragma GCC optimize("O3")
long long int gcd(long long int a, long long int b) {
  return (b ? gcd(b, a % b) : a);
}
long long int P(long long int B, long long int power, long long int modulo) {
  long long int ans = 1LL;
  while (power > 0LL) {
    if (power % 2LL == 1LL) {
      ans = (ans * B) % modulo;
    }
    B = (B * B) % modulo;
    power /= 2LL;
  }
  return ans;
}
bool isPrime(long long int n) {
  if (n <= 1LL) {
    return false;
  }
  if (n <= 3LL) {
    return true;
  }
  if (n % 2 == 0LL || n % 3 == 0LL) {
    return false;
  }
  for (long long int i = 5LL; (i * i) <= n; i += 6LL) {
    if (n % i == 0LL || n % (i + 2LL) == 0LL) {
      return false;
    }
  }
  return true;
}
using namespace std;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
bool sortbysecll(const pair<long long int, long long int> &a,
                 const pair<long long int, long long int> &b) {
  return (a.second < b.second);
}
long long int modinv(long long int x, long long int y, long long int modulo) {
  return ((x % modulo) * (P(y, modulo - 2LL, modulo) % modulo)) % modulo;
}
const int mxN = 105;
int mini[mxN], maxi[mxN];
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(NULL);
  cin.tie(NULL);
  long long int m, s;
  cin >> m >> s;
  long long int s1 = s;
  if (s > 0 && s <= (9 * m)) {
    mini[0] = 1;
    s--;
    long long int i = m - 1;
    while (i >= 0 && s > 0) {
      if (s >= 9) {
        mini[i] += 9;
        s -= 9;
      } else {
        mini[i] += s;
        s = 0;
      }
      i--;
    }
    for (long long int i = 0; i < m; i++) {
      cout << mini[i];
    }
    cout << " ";
    i = 0;
    s = s1;
    while (i < m && s > 0) {
      if (s >= 9) {
        maxi[i] = 9;
        s -= 9;
      } else {
        maxi[i] = s;
        s = 0;
      }
      i++;
    }
    for (long long int i = 0; i < m; i++) {
      cout << maxi[i];
    }
    cout << "\n";
  } else {
    if (s == 0 && m == 1) {
      cout << 0 << " " << 0 << "\n";
    } else {
      cout << -1 << " " << -1 << "\n";
    }
  }
  return 0;
}

### 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>
#pragma GCC optimize("O3")
long long int gcd(long long int a, long long int b) {
  return (b ? gcd(b, a % b) : a);
}
long long int P(long long int B, long long int power, long long int modulo) {
  long long int ans = 1LL;
  while (power > 0LL) {
    if (power % 2LL == 1LL) {
      ans = (ans * B) % modulo;
    }
    B = (B * B) % modulo;
    power /= 2LL;
  }
  return ans;
}
bool isPrime(long long int n) {
  if (n <= 1LL) {
    return false;
  }
  if (n <= 3LL) {
    return true;
  }
  if (n % 2 == 0LL || n % 3 == 0LL) {
    return false;
  }
  for (long long int i = 5LL; (i * i) <= n; i += 6LL) {
    if (n % i == 0LL || n % (i + 2LL) == 0LL) {
      return false;
    }
  }
  return true;
}
using namespace std;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
bool sortbysecll(const pair<long long int, long long int> &a,
                 const pair<long long int, long long int> &b) {
  return (a.second < b.second);
}
long long int modinv(long long int x, long long int y, long long int modulo) {
  return ((x % modulo) * (P(y, modulo - 2LL, modulo) % modulo)) % modulo;
}
const int mxN = 105;
int mini[mxN], maxi[mxN];
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(NULL);
  cin.tie(NULL);
  long long int m, s;
  cin >> m >> s;
  long long int s1 = s;
  if (s > 0 && s <= (9 * m)) {
    mini[0] = 1;
    s--;
    long long int i = m - 1;
    while (i >= 0 && s > 0) {
      if (s >= 9) {
        mini[i] += 9;
        s -= 9;
      } else {
        mini[i] += s;
        s = 0;
      }
      i--;
    }
    for (long long int i = 0; i < m; i++) {
      cout << mini[i];
    }
    cout << " ";
    i = 0;
    s = s1;
    while (i < m && s > 0) {
      if (s >= 9) {
        maxi[i] = 9;
        s -= 9;
      } else {
        maxi[i] = s;
        s = 0;
      }
      i++;
    }
    for (long long int i = 0; i < m; i++) {
      cout << maxi[i];
    }
    cout << "\n";
  } else {
    if (s == 0 && m == 1) {
      cout << 0 << " " << 0 << "\n";
    } else {
      cout << -1 << " " << -1 << "\n";
    }
  }
  return 0;
}

```