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 write(vector<long long> &oneD) {
  for (long long i = 0; i < oneD.size(); i++) {
    printf("%lld ", oneD[i]);
  }
  printf("\n");
}
void write(vector<vector<long long> > &twoD) {
  for (long long i = 0; i < twoD.size(); i++) {
    write(twoD[i]);
  }
}
void write(vector<pair<long long, long long> > &oneDP) {
  for (long long(i) = 0; (i) < (oneDP.size()); ++(i)) {
    printf("%lld %lld\n", oneDP[i].first, oneDP[i].second);
  }
  cout << "\n";
}
void write(map<long long, long long> &mpp) {
  for (map<long long, long long>::iterator it = mpp.begin(); it != mpp.end();
       it++) {
    cout << it->first << " : " << it->second << '\n';
  }
  cout << '\n';
}
bool cmp(const pair<long long, long long> &a,
         const pair<long long, long long> &b) {
  if (a.first == b.first) return (a.second >= b.second);
  return (a.first < b.first);
}
vector<long long> seive;
vector<long long> primes;
void Seive() {
  const long long maxn = 100005;
  seive.resize(maxn, 1);
  for (long long i = 2; i * i < maxn; i++) {
    if (seive[i] == 1) {
      for (long long j = i * i; j < maxn; j += i) {
        seive[j] = 0;
      }
    }
  }
  primes.push_back(2);
  for (long long i = 3; i < maxn; i += 2) {
    if (seive[i]) primes.push_back(i);
  }
}
long long isprime(long long N) {
  if (N < 2 || (!(N & 1) && N != 2)) return 0;
  for (long long i = 3; i * i <= N; i += 2) {
    if (!(N % i)) return 0;
  }
  return 1;
}
long long power(long long x, long long y, long long m) {
  long long int res = 1;
  x = x % m;
  while (y > 0) {
    if (y & 1) res = (res * x) % 1000000007;
    y = y >> 1;
    x = (x * x) % 1000000007;
  }
  return res;
}
long long modinv(long long x, long long mod = 1000000007) {
  return power(x, mod - 2, mod);
}
long long visited[550][5050];
struct Node {
  int a, b;
  string s;
};
string find_number(int a, int b) {
  queue<Node> q;
  Node temp = Node{0, 0, ""};
  visited[0][0] = 1;
  q.push(temp);
  while (!q.empty()) {
    Node t = q.front();
    q.pop();
    if (t.a == 0 && t.b == b) return (t.s);
    for (int i = 0; i < 10; i++) {
      int dd = (t.a * 10 + i) % a;
      int ss = t.b + i;
      if (ss <= b && !visited[dd][ss]) {
        visited[dd][ss] = 1;
        q.push(Node{dd, ss, t.s + char('0' + i)});
      }
    }
  }
  string ss = "-1";
  return ss;
}
long long A[1000005];
long long B[300005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long a, b, c, d;
  long long k, l, m, n, p, q, r, t, x, y;
  t = 1;
  while (t--) {
    map<long long, long long> M;
    string s;
    cin >> n >> m;
    long long mx = INT_MIN;
    cout << find_number(n, m) << '\n';
  }
  return 0;
}