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("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
using namespace std;
inline bool isDigit(char c) { return '0' <= c && c <= '9'; }
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
inline bool isSquare(T x) {
  T y = sqrt(x + 0.5);
  return (y * y) == x;
}
template <class T1, class T2>
inline T1 gcd(T1 a, T2 b) {
  return b ? gcd(b, a % b) : a;
}
template <class T1, class T2>
inline T1 eqMin(T1 &x, const T2 &y) {
  if (T1(y) < x) return x = y;
  return x;
}
template <class T1, class T2>
inline T1 eqMax(T1 &x, const T2 &y) {
  if (T1(y) > x) return x = y;
  return x;
}
template <class T1, class T2>
inline T1 min(const T1 &x, const T2 &y) {
  return x < (T1)y ? x : (T1)y;
}
template <class T1, class T2>
inline T1 max(T1 &x, const T2 &y) {
  return x > (T1)y ? x : (T1)y;
}
template <typename T>
inline T getint() {
  T x = 0, p = 1;
  char ch;
  do {
    ch = getchar();
  } while (ch <= ' ');
  if (ch == '-') p = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * p;
}
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
template <typename T>
auto operator<<(ostream &os, const T &v)
    -> decltype(v.begin(), v.end(), declval<ostream &>()) {
  os << '{';
  bool was = false;
  for (const auto &x : v) {
    if (was) os << ", ";
    was = true;
    os << x;
  }
  os << '}';
  return os;
}
template <size_t sz>
ostream &operator<<(ostream &os, const bitset<sz> &bit) {
  os << '/';
  for (int i = 0; i < sz; i++) os << bit[i];
  os << '\\';
  return os;
}
const double PI = acos(-1);
const double EPS = 1e-8;
const int INF = (int)1e8;
const long long LINF = (long long)2e18;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)1;
int s, d;
bool used[5100][510];
pair<int, int> back[5100][510];
queue<pair<int, int> > q;
vector<int> ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> d >> s;
  used[0][0] = true;
  q.push({0, 0});
  while (q.size()) {
    auto [sum, m] = q.front();
    q.pop();
    for (int i = 0; i < 10 && sum + i <= s; i++) {
      int toM = (m * 10 + i) % d;
      if (used[sum + i][toM]) {
        continue;
      }
      used[sum + i][toM] = true;
      back[sum + i][toM] = {i, m};
      q.push({sum + i, toM});
    }
  }
  if (!used[s][0]) {
    cout << -1;
    return 0;
  }
  int sum = s, m = 0;
  while (sum) {
    ans.push_back(back[sum][m].first);
    int toSum = sum - back[sum][m].first;
    int toM = back[sum][m].second;
    sum = toSum, m = toM;
  }
  reverse(ans.begin(), ans.end());
  for (auto it : ans) {
    cout << it;
  }
}