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;
const long long N = 1e5 + 5;
long long d, s;
long long vis[505][5005], dig[505][5005];
pair<long long, long long> par[505][5005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> d >> s;
  queue<pair<long long, long long> > q;
  q.push({0, 0});
  vis[0][0] = 1;
  while (!q.empty()) {
    auto ele = q.front();
    q.pop();
    if (ele.first == 0 && ele.second == s) {
      string ans = "";
      while (ele.first != 0 || ele.second != 0) {
        ans += char(dig[ele.first][ele.second] + '0');
        ele = par[ele.first][ele.second];
      }
      reverse(ans.begin(), ans.end());
      cout << ans;
      return 0;
    }
    for (long long i = 0; i < 10; i++) {
      long long rem = (ele.first * 10 + i) % d;
      long long sum = ele.second + i;
      if (vis[rem][sum] || sum > s) continue;
      par[rem][sum] = ele;
      dig[rem][sum] = i;
      vis[rem][sum] = 1;
      q.push({rem, sum});
    }
  }
  cout << "-1";
}
