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;
bool used[505][5015];
struct nonTL {
  int p, sm;
  string n;
  explicit nonTL(int p = 0, int sm = 0, string n = "")
      : p(p), sm(sm), n(std::move(n)){};
};
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int d, s;
  cin >> d >> s;
  queue<nonTL> q;
  q.push(nonTL(0, 0, ""));
  while (!q.empty()) {
    nonTL v = q.front();
    q.pop();
    if (v.sm == s && !v.p) {
      cout << v.n << '\n';
      return 0;
    }
    for (int i = 0; i < 10; ++i) {
      int tmp = (v.p * 10 + i) % d, tmp1 = v.sm + i;
      if (tmp >= d) {
        cout << "УУУУУУ, СЭБЭККЭ";
        return 9023372036854775807 / 0;
      }
      if (tmp1 <= s && !used[(tmp) % d][tmp1]) {
        used[(tmp) % d][tmp1] = true;
        q.push(nonTL(tmp, tmp1, v.n + (char)(i + '0')));
      }
    }
  }
  cout << -1 << '\n';
  return 0;
}