Problem: You are given two positive integers d and s. Find minimal positive integer n which is divisible by d and has sum of digits equal to s.

Input

The first line contains two positive integers d and s (1 ≤ d ≤ 500, 1 ≤ s ≤ 5000) separated by space.

Output

Print the required number or -1 if it doesn't exist.

Examples

Input

13 50


Output

699998


Input

61 2


Output

1000000000000000000000000000001


Input

15 50


Output

-1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
const int N = 2500002;
int f[5002][502], v[N], p[N], q[N][2], ans[N], cnt, h = 1, t, d, s;
int main() {
  scanf("%d%d", &d, &s);
  for (int i = 1; i <= 9; ++i) {
    int j = i % d;
    f[i][j] = 1, q[++t][0] = i, q[t][1] = j, v[t] = i;
    if (f[s][0]) {
      printf("%d\n", i);
      return 0;
    }
  }
  while (h <= t) {
    for (int i = 0; i <= 9; ++i) {
      int x = q[h][0] + i, y = (q[h][1] * 10 + i) % d;
      if (x > s || f[x][y]) continue;
      f[x][y] = 1, q[++t][0] = x, q[t][1] = y, v[t] = i, p[t] = h;
      if (f[s][0]) break;
    }
    if (f[s][0]) break;
    ++h;
  }
  if (f[s][0]) {
    while (t) ans[++cnt] = v[t], t = p[t];
    for (int i = cnt; i; --i) printf("%d", ans[i]);
  } else
    puts("-1");
  return 0;
}