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;
long long visited[505][5005];
long long d, s;
struct Node {
  long long d, s;
  vector<long long> v;
};
vector<long long> findNumber() {
  queue<Node> q;
  Node temp = Node{0, 0, vector<long long>()};
  visited[0][0] = 1;
  q.push(temp);
  while (!q.empty()) {
    Node u = q.front();
    q.pop();
    if (u.d == 0 && u.s == s) return u.v;
    for (int i = 0; i < 10; i++) {
      long long dd = (u.d * 10 + i) % d;
      long long ss = u.s + i;
      if (ss <= s && !visited[dd][ss]) {
        visited[dd][ss] = 1;
        vector<long long> vv = vector<long long>(u.v.begin(), u.v.end());
        vv.push_back(i);
        q.push(Node{dd, ss, vv});
      }
    }
  }
  return vector<long long>();
}
int main() {
  cin >> d >> s;
  vector<long long> v = findNumber();
  if (v.empty()) {
    cout << -1;
  } else {
    for (int i = 0; i < v.size(); i++) {
      cout << v[i];
    }
  }
  return 0;
}
