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;
int d, s;
int dp[505][5005];
pair<int, int> t[505][5005];
int cyfra[505][5005];
queue<pair<int, int> > q;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> d >> s;
  q.push(make_pair(0, 0));
  while (!q.empty()) {
    int mod = q.front().first;
    int suma = q.front().second;
    q.pop();
    if (mod == 0 and suma == s) {
      int lenght = dp[mod][s];
      string out;
      while (lenght--) {
        out.push_back(cyfra[mod][s] + '0');
        int nmod = t[mod][s].first;
        int ns = t[mod][s].second;
        mod = nmod;
        s = ns;
      }
      reverse(out.begin(), out.end());
      cout << out;
      return 0;
    }
    for (int i = 0; 10 > i; i++) {
      int nmod = (10 * mod + i) % d;
      int nsuma = suma + i;
      if (nsuma <= s and dp[nmod][nsuma] == 0 and (nmod != 0 or nsuma != 0)) {
        dp[nmod][nsuma] = dp[mod][suma] + 1;
        t[nmod][nsuma] = make_pair(mod, suma);
        cyfra[nmod][nsuma] = i;
        q.push(make_pair(nmod, nsuma));
      }
    }
  }
  cout << -1;
}
