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;
bool vis[505][5005];
int d, s;
string bfs() {
  queue<tuple<int, int, string>> q;
  q.push(make_tuple(0, 0, ""));
  vis[0][0] = 1;
  while (!q.empty()) {
    int cmod = get<0>(q.front());
    int cval = get<1>(q.front());
    string cur = get<2>(q.front());
    string nx;
    q.pop();
    if (cval > s) continue;
    if (cval == s && cmod == 0) {
      return cur;
    }
    for (int i = 0; i <= 9; ++i) {
      int md = (cmod * 10 + i) % d, vl = cval + i;
      if (!vis[md][vl]) {
        nx = cur + (char)('0' + i);
        q.push(make_tuple(md, vl, nx));
        vis[md][vl] = 1;
      }
    }
  }
  return "-1";
}
int main() {
  scanf("%d %d", &d, &s);
  cout << bfs() << "\n";
}