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 D = 505, S = 5010;
int vis[D][S] = {}, d, s;
queue<pair<int, int> > que;
pair<int, int> pre[D][S];
int dig[D][S];
void out(int x, int y) {
  if (x == 0 && y == 0) return;
  out(pre[x][y].first, pre[x][y].second);
  printf("%d", dig[x][y]);
}
int main() {
  scanf("%d%d", &d, &s);
  que.push(pair<int, int>(0, 0));
  vis[0][0] = 1;
  while (!que.empty()) {
    pair<int, int> p = que.front();
    que.pop();
    for (int i = 0; i <= 9; i++) {
      int a = (p.first * 10 + i) % d;
      int b = p.second + i;
      if (vis[a][b] || b > s) continue;
      vis[a][b] = 1;
      pre[a][b] = p;
      dig[a][b] = i;
      que.push(pair<int, int>(a, b));
    }
  }
  if (!vis[0][s])
    printf("-1\n");
  else
    out(0, s);
  return 0;
}