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;
bool vis[5050][501];
const int maxn = 5050 * 505;
int pre[maxn];
char c[maxn];
struct node {
  int s, d, idx;
};
int main() {
  int d, s;
  scanf("%d%d", &d, &s);
  queue<node> q;
  int tot = 0;
  for (int i = 1; i <= 9; ++i) {
    q.push({i, i % d, tot + 1}), ++tot, c[tot] = i + '0';
  }
  int Tail = -1;
  while (!q.empty()) {
    node u = q.front();
    q.pop();
    if (u.s == s && u.d == 0) {
      Tail = u.idx;
      break;
    }
    for (int i = 0; i <= 9; ++i) {
      int ns = u.s + i, nd = (u.d * 10 + i) % d;
      if (ns > s || vis[ns][nd]) continue;
      vis[ns][nd] = true;
      ++tot;
      c[tot] = i + '0';
      pre[tot] = u.idx;
      q.push({ns, nd, tot});
    }
  }
  if (Tail == -1) {
    puts("-1");
    return 0;
  }
  string ans;
  while (Tail) {
    ans = c[Tail] + ans;
    Tail = pre[Tail];
  }
  cout << ans << endl;
  return 0;
}