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 constexpr D = 505, S = 5005, N = 2 * S, inf = 1e8;
int d, s;
int dist[S][D];
pair<int, int> par[S][D];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  fill((int*)dist, (int*)dist + S * D, inf);
  cin >> d >> s;
  queue<pair<int, int>> Q;
  dist[0][0] = 0;
  par[0][0] = {-1, -1};
  Q.push({0, 0});
  while (!Q.empty()) {
    pair<int, int> u = Q.front();
    Q.pop();
    int sum = u.first, mod = u.second;
    for (int i = 0; i <= 9; ++i) {
      int ns = sum + i, nm = (10 * mod + i) % d;
      if (ns > s) break;
      if (dist[sum][mod] + 1 < dist[ns][nm]) {
        dist[ns][nm] = dist[sum][mod] + 1;
        par[ns][nm] = {sum, mod};
        Q.push({ns, nm});
      }
    }
  }
  if (dist[s][0] == inf) return cout << -1 << '\n', 0;
  string ans = "";
  d = 0;
  while (par[s][d].first != -1) {
    pair<int, int> g = par[s][d];
    ans += s - g.first + '0';
    s = g.first;
    d = g.second;
  }
  reverse(begin(ans), end(ans));
  cout << ans << '\n';
}
