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
#include <bits/stdc++.h>
using namespace std;
const long long maxd = 505, maxs = 5006;
bool vis[maxd][maxs];
long long jla[maxd][maxs], jlb[maxd][maxs], jlc[maxd][maxs], d, s;
queue<long long> qx, qy;
void bfs() {
  qx.push(0), qy.push(0);
  vis[0][0] = 1;
  while (!qx.empty()) {
    long long nx = qx.front(), ny = qy.front();
    qx.pop(), qy.pop();
    for (long long i = 0; i <= 9; i++) {
      long long mx = (nx * 10 + i) % d;
      long long my = ny + i;
      if (vis[mx][my] || my > s) continue;
      vis[mx][my] = 1;
      jla[mx][my] = nx;
      jlb[mx][my] = ny;
      jlc[mx][my] = i;
      qx.push(mx), qy.push(my);
    }
  }
}
void dfs(long long aa, long long bb) {
  if (aa == 0 && bb == 0) return;
  dfs(jla[aa][bb], jlb[aa][bb]);
  printf("%lld", jlc[aa][bb]);
}
signed main() {
  scanf("%lld%lld", &d, &s);
  bfs();
  if (vis[0][s] == 0)
    printf("-1\n");
  else {
    dfs(0, s);
    printf("\n");
  }
  return 0;
}
