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 bit;
  string s;
  node(){};
  node(int m, int b, string ss) { mod = m, bit = b, s = ss; }
};
bool v[501][5001];
string bfs(int d, int s) {
  queue<node> q;
  q.push(node(0, 0, ""));
  v[0][0] = true;
  while (!q.empty()) {
    node buf = q.front();
    q.pop();
    if (buf.bit <= s) {
      if (buf.mod == 0 && buf.bit == s) return buf.s;
      for (int i = 0; i < 10; i++) {
        int bmod = (buf.mod * 10 + i) % d;
        int bbit = buf.bit + i;
        if (!v[bmod][bbit]) {
          v[bmod][bbit] = true;
          q.push(node(bmod, bbit, buf.s + (char)(i + '0')));
        }
      }
    }
  }
  return "-1";
}
int main() {
  int s, d;
  cin >> d >> s;
  cout << bfs(d, s) << endl;
  return 0;
}
