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;
using LL = long long;
constexpr int N = 1e5 + 5;
int last[505][5005];
pair<int, int> par[505][5050];
void print(int mod, int sum) {
  if (last[mod][sum] == -1) return;
  print(par[mod][sum].first, par[mod][sum].second);
  cout << last[mod][sum];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int d, s;
  cin >> d >> s;
  queue<pair<int, int>> Q;
  memset(last, -1, sizeof last);
  for (int i = 1; i <= 9; i++) {
    Q.push({i % d, i});
    last[i % d][i] = i;
    par[i % d][i] = {0, 0};
  }
  while (!Q.empty()) {
    int mod = Q.front().first, sum = Q.front().second;
    Q.pop();
    if (sum > s) continue;
    for (int i = 0; i <= 9; i++) {
      int nmod = (mod * 10 + i) % d;
      int nsum = sum + i;
      if (last[nmod][nsum] != -1) continue;
      last[nmod][nsum] = i;
      par[nmod][nsum] = {mod, sum};
      Q.push({nmod, nsum});
    }
  }
  if (last[0][s] == -1)
    cout << -1;
  else
    print(0, s);
}