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;
struct data {
  int r = 0, x = 0;
  string s = "";
  data(int p, int q, string st) { r = p, x = q, s = st; }
};
bool vis[502][5002];
int main() {
  int d, s, p, z, l;
  char ch;
  string n;
  bool flag = false;
  cin >> d >> s;
  data root(0, 0, "");
  queue<data> q;
  q.push(root);
  vis[0][0] = true;
  while (!q.empty()) {
    data u = q.front();
    q.pop();
    if (u.r == 0 && u.x == s) {
      n = u.s, flag = true;
      break;
    }
    if (u.x > s) continue;
    for (int i = 0; i < 10; i++) {
      p = (u.r * 10 + i) % d;
      z = u.x + i;
      ch = i + 48;
      if (i)
        n[l - 1] = ch;
      else {
        n = u.s;
        n.push_back(ch);
        l = n.length();
      }
      if (vis[p][z]) continue;
      q.push(data(p, z, n));
      vis[p][z] = true;
    }
  }
  if (flag)
    cout << n << endl;
  else
    cout << -1 << endl;
  return 0;
}