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
#include <bits/stdc++.h>
using namespace std;
struct cell {
  int d;
  int s;
  string num;
};
bool V[501][5001];
string calcola(int D, int S) {
  queue<cell> q;
  q.push({0, 0, string("")});
  V[0][0] = 1;
  while (q.size()) {
    cell front = q.front();
    q.pop();
    if (front.d == 0 && front.s == S) {
      return front.num;
    }
    for (int i = 0; i <= 9; i++) {
      int nd = (front.d * 10 + i) % D;
      int ns = front.s + i;
      if (!V[nd][ns] && ns <= S) {
        q.push({nd, ns, front.num + (char)(i + '0')});
        V[nd][ns] = 1;
      }
    }
  }
  return "-1";
}
int main() {
  int D, S;
  scanf("%d%d", &D, &S);
  printf("%s\n", calcola(D, S).c_str());
}
