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 MX = 5e2 + 10, MD = 1e9 + 7;
long long n, m, a[MX], tmp, dist[MX][MX * 10], num[MX][MX * 10], d, s;
pair<int, int> par[MX][MX * 10];
vector<int> ans;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  memset(dist, -1, sizeof(dist));
  dist[0][0] = 0;
  cin >> d >> s;
  queue<pair<int, int>> q;
  q.push({0, 0});
  while (q.size()) {
    pair<int, int> pa = q.front();
    q.pop();
    int md = pa.first, sum = pa.second;
    for (int i = 0; i < 10; i++) {
      if (sum + i > s) continue;
      if (dist[(md * 10 + i) % d][sum + i] == -1) {
        dist[(md * 10 + i) % d][sum + i] = dist[md][sum] + 1;
        q.push({(md * 10 + i) % d, sum + i});
        num[(md * 10 + i) % d][sum + i] = i;
        par[(md * 10 + i) % d][sum + i] = {md, sum};
      }
    }
  }
  if (dist[0][s] == -1) return cout << -1, 0;
  pair<int, int> pa = {0, s};
  while (!(pa.first == 0 && pa.second == 0)) {
    int md = pa.first, sum = pa.second;
    ans.push_back(num[md][sum]);
    pa = par[md][sum];
  }
  reverse(ans.begin(), ans.end());
  for (auto ka : ans) cout << ka;
}