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;
  int sum;
  string res;
  node(int a, int b, string c) {
    mod = a;
    sum = b;
    res = c;
  }
};
int vis[505][5005];
string bfs(int d, int s) {
  queue<node> q;
  q.push(node(0, 0, ""));
  vis[0][0] = 1;
  while (!q.empty()) {
    node t = q.front();
    q.pop();
    if (t.mod == 0 && t.sum == s) return t.res;
    for (int i = 0; i <= 9; i++) {
      int mod = (t.mod * 10 + i) % d;
      int sum = t.sum + i;
      if (sum > s || vis[mod][sum]) continue;
      string res = t.res;
      char z = i + '0';
      res += z;
      q.push(node(mod, sum, res));
      vis[mod][sum] = 1;
    }
  }
  return "-1";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int d, s;
  cin >> d >> s;
  cout << bfs(d, s) << '\n';
  return 0;
}
