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;
long long int em(long long int x, long long int Mod, long long int n) {
  if (n == 0)
    return 1ll;
  else if (n % 2 == 0)
    return em((x % Mod * x % Mod) % Mod, Mod, n / 2) % Mod;
  else
    return (x % Mod * em((x % Mod * x % Mod) % Mod, Mod, (n - 1) / 2)) % Mod;
}
pair<long long int, pair<long long int, long long int>> dp[5009][509];
long long int d, s;
void fun() {
  long long int i, j, k;
  queue<pair<long long int, pair<long long int, long long int>>> q;
  q.push({0, {0, 0}});
  while (!q.empty()) {
    pair<long long int, pair<long long int, long long int>> y = q.front();
    q.pop();
    long long int mo = y.first;
    long long int pos = y.second.first;
    long long int len = y.second.second;
    for (long long int i = (long long int)0; i < (long long int)10; i++) {
      long long int npos = pos + i;
      if (npos > s) continue;
      long long int nmod = (mo * 10 + i) % d;
      if (dp[npos][nmod].first == -1) {
        dp[npos][nmod] = {mo, {len + 1, i}};
        q.push({nmod, {npos, len + 1}});
      }
      if (nmod == 0 && npos == s) break;
    }
  }
}
int32_t main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int i, j, k, l;
  cin >> d >> s;
  memset(dp, -1, sizeof(dp));
  fun();
  if (dp[s][0].first == -1) {
    cout << "-1";
    return 0;
  }
  long long int now = s, mo = 0;
  vector<long long int> ans;
  while (now) {
    ans.push_back(dp[now][mo].second.second);
    long long int nmodu = dp[now][mo].first;
    now -= dp[now][mo].second.second;
    mo = nmodu;
  }
  long long int sz = ans.size();
  for (i = sz - 1; i >= 0; i--) cout << ans[i];
}
