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>
using namespace std;
int d, s;
struct node {
  int mod, sum;
  char s[700];
  int len;
};
queue<node> Q;
bool v[512][5200];
int main() {
  scanf("%d%d", &d, &s);
  Q.push({0, 0, 0, 0});
  while (!Q.empty()) {
    node a = Q.front();
    Q.pop();
    for (int i = 0; i < 10; i++) {
      node b = a;
      b.s[b.len++] = i + '0';
      b.mod = (b.mod * 10 + i) % d;
      b.sum += i;
      if (v[b.mod][b.sum] || b.sum > s) continue;
      v[b.mod][b.sum] = 1;
      if (b.mod == 0 && b.sum == s) {
        puts(b.s);
        return 0;
      }
      Q.push(b);
    }
  }
  puts("-1");
  return 0;
}