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 N = (int)1e6 + 228;
const int INF = (int)1e9 + 228;
pair<int, int> p[5005][505];
bool used[5005][505];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int d, s;
  cin >> d >> s;
  queue<pair<int, int>> Q;
  Q.push({0, 0});
  used[0][0] = true;
  while (!Q.empty()) {
    int sum = Q.front().first;
    int ost = Q.front().second;
    Q.pop();
    for (int dig = 0; dig < 10; dig++) {
      int nsum = sum + dig;
      int nost = (ost * 10 + dig) % d;
      if (nsum > s || used[nsum][nost]) {
        continue;
      }
      p[nsum][nost] = {sum, ost};
      used[nsum][nost] = true;
      Q.push({nsum, nost});
    }
  }
  if (!used[s][0]) {
    cout << -1;
    return 0;
  }
  int x = s, y = 0;
  vector<int> path;
  while (x != 0) {
    int px = p[x][y].first;
    int py = p[x][y].second;
    path.push_back(x - px);
    x = px;
    y = py;
  }
  reverse(path.begin(), path.end());
  for (int i : path) {
    cout << i;
  }
  return 0;
}