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;
const int iinf = 1 << 29;
const long long inf = 1ll << 60;
const long long mod = 1e9 + 7;
void GG() {
  cout << "0\n";
  exit(0);
}
long long mpow(long long a, long long n, long long mo = mod) {
  long long re = 1;
  while (n > 0) {
    if (n & 1) re = re * a % mo;
    a = a * a % mo;
    n >>= 1;
  }
  return re;
}
long long inv(long long b, long long mo = mod) {
  if (b == 1) return b;
  return (mo - mo / b) * inv(mo % b) % mo;
}
const int maxn = 1e6 + 5;
bool vis[505][5105];
struct nd {
  int m, second;
  string str = "";
  nd(int m, int second, string str) : m(m), second(second), str(str) {}
};
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int D, S;
  cin >> D >> S;
  queue<nd> q;
  q.push({0, 0, ""});
  vis[0][0] = 1;
  while (!q.empty()) {
    nd x = q.front();
    q.pop();
    if (x.second > S) continue;
    if (x.m == 0 && x.second == S) {
      cout << x.str << '\n';
      return 0;
    }
    for (int i = 0; i < (10); i++) {
      int newm = (x.m * 10 + i) % D;
      int news = x.second + i;
      if (!vis[newm][news]) {
        vis[newm][news] = 1;
        q.push({newm, news, x.str + (char)(i + '0')});
      }
    }
  }
  cout << "-1";
}