#include <bits/stdc++.h>
using namespace std;
int m, l, s;
char c[103];
unsigned long long int dp[105][905];
unsigned long long int fun(int pos, int fl) {
  int l;
  if (pos == m) {
    if (fl == 0)
      return 1LL;
    else
      return 0LL;
  }
  if (pos == 0)
    l = 1;
  else
    l = 0;
  if (m == 1 && pos == 0) l = 0;
  unsigned long long int &r = dp[pos][fl];
  if (r != -1) return r;
  r = 0;
  for (int i = l; i < 10; i++) {
    if ((fl - i) >= 0)
      r |= fun(pos + 1, fl - i);
    else
      break;
  }
  return r;
}
void path(int pos, int fl, unsigned long long int cnt) {
  if (pos == m) {
    return;
  }
  if (pos == 0)
    l = 1;
  else
    l = 0;
  for (int i = l; i < 10; i++) {
    if ((fl - i) >= 0) {
      unsigned long long int l = fun(pos, fl);
      cout << l << "con" << endl;
      if (cnt <= l) {
        cout << i;
        return path(pos + 1, fl - i, cnt);
      }
      cnt -= fun(pos + 1, fl - i);
    }
  }
  return;
}
void path1(int pos, int fl) {
  if (pos == m) {
    return;
  }
  if (pos == 0)
    l = 1;
  else
    l = 0;
  if (m == 1 && pos == 0) l = 0;
  for (int i = l; i < 10; i++) {
    if ((fl - i) >= 0) {
      unsigned long long int l = fun(pos + 1, fl - i);
      if (l >= 1) {
        cout << i;
        return path1(pos + 1, fl - i);
      }
    }
  }
  return;
}
void path2(int pos, int fl) {
  if (pos == m) {
    return;
  }
  if (pos == 0)
    l = 1;
  else
    l = 0;
  if (m == 1 && pos == 0) l = 0;
  for (int i = 9; i >= 0; i--) {
    if ((fl - i) >= 0) {
      unsigned long long int l = fun(pos, fl);
      if (l == 1) {
        cout << i;
        return path2(pos + 1, fl - i);
      }
    }
  }
  return;
}
int main() {
  cin >> m >> s;
  memset(dp, -1, sizeof(dp));
  unsigned long long int r = fun(0, s);
  if (r) {
    path1(0, s);
  } else
    cout << "-1";
  cout << " ";
  if (r) {
    path2(0, s);
    cout << endl;
  } else
    cout << "-1" << endl;
}

### Prompt

Create a solution in CPP for 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;
int m, l, s;
char c[103];
unsigned long long int dp[105][905];
unsigned long long int fun(int pos, int fl) {
  int l;
  if (pos == m) {
    if (fl == 0)
      return 1LL;
    else
      return 0LL;
  }
  if (pos == 0)
    l = 1;
  else
    l = 0;
  if (m == 1 && pos == 0) l = 0;
  unsigned long long int &r = dp[pos][fl];
  if (r != -1) return r;
  r = 0;
  for (int i = l; i < 10; i++) {
    if ((fl - i) >= 0)
      r |= fun(pos + 1, fl - i);
    else
      break;
  }
  return r;
}
void path(int pos, int fl, unsigned long long int cnt) {
  if (pos == m) {
    return;
  }
  if (pos == 0)
    l = 1;
  else
    l = 0;
  for (int i = l; i < 10; i++) {
    if ((fl - i) >= 0) {
      unsigned long long int l = fun(pos, fl);
      cout << l << "con" << endl;
      if (cnt <= l) {
        cout << i;
        return path(pos + 1, fl - i, cnt);
      }
      cnt -= fun(pos + 1, fl - i);
    }
  }
  return;
}
void path1(int pos, int fl) {
  if (pos == m) {
    return;
  }
  if (pos == 0)
    l = 1;
  else
    l = 0;
  if (m == 1 && pos == 0) l = 0;
  for (int i = l; i < 10; i++) {
    if ((fl - i) >= 0) {
      unsigned long long int l = fun(pos + 1, fl - i);
      if (l >= 1) {
        cout << i;
        return path1(pos + 1, fl - i);
      }
    }
  }
  return;
}
void path2(int pos, int fl) {
  if (pos == m) {
    return;
  }
  if (pos == 0)
    l = 1;
  else
    l = 0;
  if (m == 1 && pos == 0) l = 0;
  for (int i = 9; i >= 0; i--) {
    if ((fl - i) >= 0) {
      unsigned long long int l = fun(pos, fl);
      if (l == 1) {
        cout << i;
        return path2(pos + 1, fl - i);
      }
    }
  }
  return;
}
int main() {
  cin >> m >> s;
  memset(dp, -1, sizeof(dp));
  unsigned long long int r = fun(0, s);
  if (r) {
    path1(0, s);
  } else
    cout << "-1";
  cout << " ";
  if (r) {
    path2(0, s);
    cout << endl;
  } else
    cout << "-1" << endl;
}

```