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;
void fun() {}
long long int __gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return __gcd(b, a % b);
}
long long int poww(long long int a, long long int b, long long int md) {
  if (b < 0) return 0;
  if (a == 0) return 0;
  long long int res = 1;
  while (b) {
    if (b & 1) {
      res = (1ll * res * a) % md;
    }
    a = (1ll * a * a) % md;
    b >>= 1;
  }
  return res;
}
long long int divide(long long int a, long long int b, long long int md) {
  long long int rr = a * (poww(b, md - 2, md));
  rr %= md;
  return rr;
}
const long long int size = 2e5 + 5;
bool vis[500][5001];
long long int d, s;
struct node {
  long long int modd, sum;
  string number;
  node(long long int m, long long int sm, string nn) {
    modd = m;
    sum = sm;
    number = nn;
  }
};
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  fun();
  cin >> d >> s;
  queue<node> Q;
  Q.push(node(0, 0, ""));
  vis[0][0] = 1;
  while (!Q.empty()) {
    node current = Q.front();
    Q.pop();
    if (current.modd == 0 && current.sum == s) {
      return cout << current.number << '\n', 0;
    }
    for (long long int i = 0; i <= 9; i++) {
      long long int nmodd = (current.modd * 10 + i) % d;
      long long int nsum = current.sum + i;
      if (nsum < 5001 && !vis[nmodd][nsum]) {
        vis[nmodd][nsum] = 1;
        string nnumber = current.number + to_string(i);
        Q.push(node(nmodd, nsum, nnumber));
      }
    }
  }
  cout << "-1\n";
  return 0;
}