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 = 5005;
bool vis[505][N];
int d, s;
struct Node {
  int x, y;
  vector<int> co;
};
queue<Node> q;
bool BFS() {
  Node t;
  memset(vis, 0, sizeof(vis));
  vis[0][0] = 1;
  t.x = t.y = 0;
  t.co.clear();
  q.push(t);
  while (!q.empty()) {
    t = q.front();
    q.pop();
    for (int i = 0; i <= 9; i++) {
      int xx = (t.x * 10 + i) % d, yy = t.y + i;
      if (vis[xx][yy] || yy > s) continue;
      vis[xx][yy] = true;
      Node p;
      p = t;
      p.x = xx, p.y = yy, p.co.push_back(i);
      if (xx == 0 && yy == s) {
        for (int j = 0; j < p.co.size(); j++) printf("%d", p.co[j]);
        putchar('\n');
        return true;
      }
      q.push(p);
    }
  }
  return false;
}
int main() {
  scanf("%d%d", &d, &s);
  if (BFS() == 0) printf("-1\n");
}