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 Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int spf[1000000 + 2];
vector<int> primes;
void seive() {
  int i, j;
  int prime[1000000];
  for (i = 1; i < 1000000; i++) {
    prime[1000000] = 1;
  }
  for (i = 4; i < 1000000; i += 2) {
    prime[i] = 0;
  }
  for (i = 3; i * i < 1000000; i += 2) {
    if (prime[i]) {
      for (j = i * i; j < 1000000; j += i) {
        prime[j] = 0;
      }
    }
  }
  for (i = 2; i < 1000000; i++) {
    if (prime[i]) {
      primes.push_back(i);
    }
  }
}
int factor(int x) {
  int ans = 1;
  int i;
  for (i = 0; i < primes.size() and primes[i] * primes[i] <= x; i++) {
    if (x % primes[i] == 0) {
      int cnt = 0;
      while (x % primes[i] == 0) {
        cnt++;
        x /= primes[i];
      }
      if (cnt & 1) {
        ans *= primes[i];
      }
    }
  }
  if (x != 1) {
    ans *= x;
  }
  return ans;
}
class help {
 public:
  int md;
  int sum;
  string s;
  int len;
  help(int md, string s, int sum, int len) {
    this->md = md;
    this->sum = sum;
    this->s = s;
    this->len = len;
  }
};
bool dp[505][5001] = {0};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int i, j, k, n, l, m, t;
  t = 1;
  while (t--) {
    int d;
    cin >> d >> k;
    queue<help> q;
    help h(0, "", 0, 0);
    q.push(h);
    bool ok = 0;
    int md;
    int s;
    string temp;
    int len;
    while (!q.empty()) {
      auto f = q.front();
      q.pop();
      for (i = 0; i < 10; i++) {
        md = f.md;
        s = f.sum;
        temp = f.s;
        len = f.len;
        md = ((md * 10) + i) % d;
        temp += ((i + '0'));
        s += i;
        len++;
        if (s > k)
          break;
        else if (dp[md][s]) {
          continue;
        } else {
          dp[md][s] = 1;
          help hh(md, temp, s, len);
          if ((md == 0) and (s == k)) {
            cout << temp << "\n";
            ok = 1;
            return 0;
            break;
          }
          q.push(hh);
        }
      }
      if (ok) break;
    }
    if (!ok) {
      cout << -1 << "\n";
    }
  }
}
