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, vis[510][5010], id[510][5010];
struct node {
  int x, y;
} f[510][5010];
queue<node> q;
void output(int x, int y) {
  if (x == 0 && y == 0) return;
  output(f[x][y].x, f[x][y].y);
  printf("%d", id[x][y]);
}
int main() {
  scanf("%d%d", &d, &s);
  q.push((node){0, 0});
  vis[0][0] = 1;
  while (!q.empty()) {
    int x = q.front().x, y = q.front().y;
    q.pop();
    for (int i = 0; i <= 9; i++) {
      int xx = (x * 10 + i) % d, yy = y + i;
      if (vis[xx][yy] || yy > s) continue;
      vis[xx][yy] = 1;
      f[xx][yy].x = x;
      f[xx][yy].y = y;
      id[xx][yy] = i;
      q.push((node){xx, yy});
    }
  }
  if (!vis[0][s]) {
    printf("-1");
    return 0;
  }
  output(0, s);
}