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 x, y;
  node(int X = 0, int Y = 0) {
    x = X;
    y = Y;
  }
};
bool vis[505][5005];
node pre[505][5005];
int main() {
  scanf("%d%d", &d, &s);
  queue<node> q;
  q.push(node(0, 0));
  vis[0][0] = 1;
  while (!q.empty()) {
    node u = q.front();
    q.pop();
    int x = u.x, y = u.y;
    for (int i = 0; i <= 9; ++i) {
      node v = node((x * 10 + i) % d, y + i);
      if (v.y > s) continue;
      if (vis[v.x][v.y]) continue;
      pre[v.x][v.y] = u;
      q.push(v);
      vis[v.x][v.y] = 1;
    }
  }
  if (!vis[0][s]) {
    puts("-1");
    return 0;
  }
  stack<int> stk;
  node u = node(0, s);
  while (1) {
    node v = pre[u.x][u.y];
    stk.push(u.y - v.y);
    if (v.x == 0 && v.y == 0) break;
    u = v;
  }
  while (!stk.empty()) {
    int x = stk.top();
    stk.pop();
    printf("%d", x);
  }
  return 0;
}