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>
#pragma GCC optimize("Ofast")
using namespace std;
struct node {
  int sum, mod;
  string res;
};
int d, s;
bool vis[5001][500];
int bfs() {
  queue<node> q;
  q.push({0, 0, ""});
  vis[0][0] = true;
  int ans = 0;
  while (q.size()) {
    node n = q.front();
    q.pop();
    if (n.sum == s && n.mod == 0) {
      cout << n.res << "\n";
      ans = 1;
      break;
    }
    for (int v = 0; v < 10; v++) {
      int aux_sum = n.sum + v;
      int aux_mod = (n.mod * 10 + v) % d;
      if (aux_sum <= s && !vis[aux_sum][aux_mod]) {
        vis[aux_sum][aux_mod] = true;
        q.push({aux_sum, aux_mod, n.res + (char)(v + '0')});
      }
    }
    n.res.clear();
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> d >> s;
  if (!bfs()) {
    cout << "-1\n";
    return 0;
  }
}