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;
bool vis[510][5050];
int pre[510][5050][3];
queue<int> Qx, Qy;
void BFS() {
  memset(vis, 0, sizeof(vis));
  vis[0][0] = 1;
  Qx.push(0);
  Qy.push(0);
  while (!Qx.empty()) {
    int x = Qx.front(), y = Qy.front();
    Qx.pop();
    Qy.pop();
    for (int i = 0; i <= 9; i++) {
      int x1 = (10 * x + i) % d, y1 = y + i;
      if (vis[x1][y1] || y1 > s) continue;
      vis[x1][y1] = 1;
      pre[x1][y1][0] = x;
      pre[x1][y1][1] = y;
      pre[x1][y1][2] = i;
      Qx.push(x1);
      Qy.push(y1);
    }
  }
}
void DFS(int x, int y) {
  if (x == 0 && y == 0) return;
  DFS(pre[x][y][0], pre[x][y][1]);
  printf("%d", pre[x][y][2]);
}
int main() {
  cin >> d >> s;
  BFS();
  if (vis[0][s] == 0)
    printf("-1\n");
  else
    DFS(0, s);
  return 0;
}