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;
struct Node {
  int mod, sum;
  string s;
};
bool vis[505][5005];
queue<Node> Q;
string BFS(int p, int x) {
  vis[0][0] = 1;
  Q.push((Node){0, 0, ""});
  while (!Q.empty()) {
    Node u = Q.front();
    Q.pop();
    if (u.mod == 0 && u.sum == x) return u.s;
    for (int i = 0; i <= 9; i++) {
      if (u.sum + i > x) continue;
      int nmod = (u.mod * 10 + i) % p;
      int nsum = u.sum + i;
      if (vis[nmod][nsum]) continue;
      vis[nmod][nsum] = 1;
      Node v = (Node){nmod, nsum, u.s + (char)(i + '0')};
      Q.push(v);
    }
  }
  return "-1";
}
int main() {
  ios::sync_with_stdio(false);
  int p, x;
  cin >> p >> x;
  cout << BFS(p, x);
  return 0;
}
