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 MXN = 5e3 + 10;
const long long MXM = 500 + 10;
long long d, s;
long long dis[MXM][MXN];
pair<long long, long long> par[MXM][MXN];
queue<pair<long long, long long>> q;
string ANS;
void BFS() {
  memset(dis, 63, sizeof dis);
  dis[0][0] = 0, q.push({0, 0});
  while (!q.empty()) {
    long long x = q.front().first, y = q.front().second, xp, yp;
    q.pop();
    for (int i = 0; i <= 9; i++) {
      xp = (x * 10 + i) % d, yp = y + i;
      if (yp <= s && dis[xp][yp] >= 1e17) {
        dis[xp][yp] = dis[x][y] + 1, par[xp][yp] = {x, i};
        q.push({xp, yp});
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> d >> s;
  BFS();
  if (dis[0][s] >= 1e17) return cout << -1, 0;
  long long x = 0, y = s, now;
  while (y) {
    now = par[x][y].second;
    ANS += (char)(now + '0');
    x = par[x][y].first, y -= now;
  }
  reverse(ANS.begin(), ANS.end());
  cout << ANS << '\n';
  return 0;
}
