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;
long long dig[505][5005];
long long be[505][5005];
long long af[505][5005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long d, s, i, j;
  cin >> d >> s;
  memset(dig, 1000000007, sizeof(dig));
  dig[0][0] = 0;
  queue<pair<long long, long long> > qu;
  qu.push(make_pair(0, 0));
  while (!qu.empty()) {
    pair<long long, long long> x = qu.front();
    qu.pop();
    for (j = 0; j < 10; j++) {
      long long ym = (x.first * 10 + j) % d;
      long long ys = (x.second + j);
      if (ys > s) continue;
      if (dig[x.first][x.second] + 1 >= dig[ym][ys]) continue;
      dig[ym][ys] = dig[x.first][x.second] + 1;
      qu.push(make_pair(ym, ys));
      be[ym][ys] = x.first;
      af[ym][ys] = j;
    }
  }
  if (dig[0][s] >= 1000000000) {
    cout << -1 << endl;
    return 0;
  }
  vector<long long> ans;
  long long r = 0;
  while (s != 0) {
    ans.push_back(af[r][s]);
    long long temp = s;
    s -= af[r][s];
    r = be[r][temp];
  }
  reverse(ans.begin(), ans.end());
  for (i = 0; i < ans.size(); i++) cout << ans[i];
}
