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;
struct node {
  int m;
  int sum;
  string num;
  node(){};
  node(int mm, int s, string n) { m = mm, sum = s, num = n; }
};
queue<node> q;
int vis[505][5005];
string bfs(int d, int s) {
  q.push(node(0, 0, ""));
  vis[0][0] = 1;
  while (!q.empty()) {
    node x = q.front();
    q.pop();
    if (x.sum <= s) {
      if (x.m == 0 && x.sum == s) {
        return x.num;
      }
      for (int i = 0; i < 10; i++) {
        int a = (x.m * 10 + i) % d;
        int b = (x.sum + i);
        if (!vis[a][b]) {
          vis[a][b] = 1;
          q.push(node(a, b, x.num + (char)(i + '0')));
        }
      }
    }
  }
  return "-1";
}
int main() {
  int N, M;
  memset(vis, 0, sizeof(vis));
  scanf("%d%d", &N, &M);
  cout << bfs(N, M) << endl;
  return 0;
}