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>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
const long long M = 2e5 + 10, M2 = 1e7 + 10, oo = 1e9 + 7, mod = 998244353;
const long long MC = (1 << 20) + 5;
void precomp() {}
pair<int, int> pr[5002][502];
int vis[5002][502];
void solve() {
  int d, s;
  cin >> d >> s;
  for (int i = 0; i < 5002; i++) {
    for (int j = 0; j < 502; j++) pr[i][j] = pair<int, int>(-1, -1);
  }
  queue<pair<int, int> > q;
  q.push(pair<int, int>(0, 0));
  vis[0][0] = 1;
  int got = 0;
  while (q.size()) {
    pair<int, int> pu = q.front();
    q.pop();
    int ps = pu.first, pd = pu.second;
    for (int i = 0; i < 10; i++) {
      int cs = ps + i, cd = (pd * 10 + i) % d;
      if (cs > s || vis[cs][cd]) continue;
      vis[cs][cd] = 1;
      pr[cs][cd] = pair<int, int>(ps, pd);
      if (cs == s && cd == 0) {
        got = 1;
        break;
      }
      q.push(pair<int, int>(cs, cd));
    }
  }
  if (got) {
    string ns;
    int cs = s, cd = 0;
    while (pr[cs][cd] != pair<int, int>(-1, -1)) {
      pair<int, int> pu = pr[cs][cd];
      int ps = pu.first, pd = pu.second;
      int d = cs - ps;
      assert(!(d < 0 || d > 9));
      ns.push_back((char)(cs - ps + '0'));
      cs = ps, cd = pd;
    }
    reverse(ns.begin(), ns.end());
    cout << ns << endl;
    return;
  }
  cout << -1 << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  precomp();
  solve();
  return 0;
}