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;
queue<pair<int, int> > q;
pair<pair<int, int>, bool> sol[505][5005];
void solve(int cf, int sum) {
  if (sum == s) return;
  solve(sol[cf][sum].first.first, sum + sol[cf][sum].first.second);
  cout << sol[cf][sum].first.second;
}
int main() {
  cin >> d >> s;
  for (int i = 1; i <= 9; i++) {
    if (s < i) break;
    q.push({i % d, s - i});
    sol[i % d][s - i] = {{0, i}, 1};
  }
  while (!q.empty()) {
    auto x = q.front();
    q.pop();
    if (!x.first && !x.second) {
      solve(0, 0);
      return 0;
    }
    for (int i = 0; i <= 9 && i <= x.second; i++) {
      int a = (x.first * 10 + i) % d, b = x.second - i;
      if (!sol[a][b].second) {
        q.push({a, b});
        sol[a][b] = {{x.first, i}, 1};
      }
    }
  }
  cout << -1;
  return 0;
}