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 comment(linker, "/STACK:167772160000")
template <typename T>
using min_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template <typename T>
using max_heap = std::priority_queue<T, std::vector<T>, std::less<T>>;
const long double PI = asin(1) * 2;
using namespace std;
int digits[5000 + 1][500 + 1];
std::pair<int, int> prevs[5000 + 1][500 + 1];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int d, s;
  cin >> d >> s;
  for (int i = (0); i < (s + 1); i++) {
    for (int j = (0); j < (d); j++) {
      digits[i][j] = -1;
    }
  }
  queue<std::pair<int, int>> Q;
  Q.push({0, 0});
  while (!Q.empty()) {
    auto t = Q.front();
    Q.pop();
    int S = t.first;
    int M = t.second;
    if (S == s && M == 0) {
      int i = S, j = M;
      vector<int> ans;
      while (!(i == 0 && j == 0)) {
        ans.push_back(digits[i][j]);
        auto p = prevs[i][j];
        i = p.first;
        j = p.second;
      }
      reverse(ans.begin(), ans.end());
      for (auto x : ans) cout << x;
      return 0;
    }
    for (int dig = (0); dig < (10); dig++) {
      if (S + dig > 5000) continue;
      int newM = (10 * M + dig) % d;
      int newS = S + dig;
      if (digits[newS][newM] == -1) {
        digits[newS][newM] = dig;
        prevs[newS][newM] = {S, M};
        Q.push({newS, newM});
      }
    }
  }
  cout << -1;
  return 0;
}