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;
long long dp[505][5050];
array<int, 3> pa[505][5050];
void solve() {
  long long m, s;
  cin >> m >> s;
  for (int i = 0; i < 505; i++)
    for (int j = 0; j < 5050; j++) dp[i][j] = 1e9;
  vector<pair<int, pair<int, int> > > q;
  q.push_back({0, {0, 0}});
  dp[0][0] = 0;
  for (int i = 0; i < q.size(); i++) {
    auto it = q[i];
    int r = it.second.first;
    int si = it.second.second;
    for (int w = 0; w < 10; w++) {
      if (si + w <= s && dp[(r * 10 + w) % m][si + w] == 1e9) {
        dp[(r * 10 + w) % m][si + w] = dp[r][si] + 1;
        pa[(r * 10 + w) % m][si + w] = {r, si, w};
        q.push_back({dp[r][si] + 1, {(r * 10 + w) % m, si + w}});
      }
    }
  }
  if (dp[0][s] == 1e9) {
    cout << -1;
    return;
  }
  vector<int> ans;
  int md = 0, si = s;
  for (int i = 0; i < dp[0][s]; i++) {
    array<int, 3> x = pa[md][si];
    ans.push_back(x.at(2));
    md = x.at(0), si = x.at(1);
  }
  reverse(ans.begin(), ans.end());
  for (auto e : ans) cout << e;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}