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;
template <typename T>
inline void Int(T &n) {
  n = 0;
  int f = 1;
  register int ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
  n = n * f;
}
template <typename T>
T gcd(T a, T b) {
  return !b ? a : gcd(b, a % b);
}
template <typename T>
inline void umin(T &a, T b) {
  a = a < b ? a : b;
}
template <typename T>
inline void umax(T &a, T b) {
  a = a > b ? a : b;
}
template <typename T, typename W>
inline void Int(T &x, W &y) {
  Int(x), Int(y);
}
template <typename T, typename W, typename Q>
void Int(T &x, W &y, Q &z) {
  Int(x, y), Int(z);
}
const int N = 1e5 + 7;
const int inf = 1e9 + 7;
int digit[500][5001];
pair<int, int> dp[500][5001];
int solve() {
  int d, s;
  cin >> d >> s;
  memset(digit, -1, sizeof digit);
  queue<pair<int, int> > q;
  q.push({0, 0});
  dp[0][0] = {0, 0};
  while (not q.empty()) {
    auto u = q.front();
    q.pop();
    int ud = u.first, us = u.second;
    for (int i = 0; i <= 9; ++i) {
      int nd = (ud * 10 + i) % d, ns = us + i;
      if (ns <= s and digit[nd][ns] == -1) {
        q.push({nd, ns});
        digit[nd][ns] = i;
        dp[nd][ns] = {ud, us};
      }
    }
  }
  if (digit[0][s] == -1) return printf("-1\n");
  string res = "";
  pair<int, int> u = {0, s};
  while (u != make_pair(0, 0)) {
    res += to_string(digit[u.first][u.second]);
    u = dp[u.first][u.second];
  }
  reverse(res.begin(), res.end());
  cout << res << '\n';
  return 0;
}
int main() {
  int tests = 1, CaseNo = 0;
  while (tests--) {
    solve();
  }
  return 0;
}
