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;
const int maxn = 501, maxm = 5001;
struct node {
  int d, s;
  string str;
  node(int d = 0, int s = 0, string str = "") : d(d), s(s), str(str){};
};
bool num[maxn][maxm];
int main() {
  int d, s, mark;
  scanf("%d%d", &d, &s);
  queue<node> q;
  mark = 0;
  num[0][0] = true;
  q.push(node(0, 0, ""));
  while (not q.empty()) {
    node tmp = q.front();
    q.pop();
    if (tmp.s > s) continue;
    if (tmp.d == 0 and tmp.s == s) {
      cout << tmp.str << '\n';
      mark = 1;
      break;
    }
    int td, ts;
    string tstr;
    for (int i = 0; i < 10; ++i) {
      td = (10 * tmp.d + i) % d;
      ts = tmp.s + i;
      if (!num[td][ts]) {
        num[td][ts] = true;
        q.push(node(td, ts, tmp.str + (char)(i + '0')));
      }
    }
  }
  if (!mark) printf("-1\n");
  return 0;
}