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 {
  string num;
  int sum, mod;
};
bool vis[510][5010];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int d, s;
  cin >> d >> s;
  string ans = "-1";
  queue<node> q;
  q.push({"", 0, 0});
  vis[0][0] = true;
  while (!q.empty()) {
    auto x = q.front();
    q.pop();
    if (x.mod == 0 && x.sum == s) {
      ans = x.num;
      break;
    }
    for (int i = 0; i <= 9; i++) {
      int curr_m = (x.mod * 10 + i) % d;
      int curr_s = x.sum + i;
      if (!vis[curr_m][curr_s] && curr_s <= s) {
        vis[curr_m][curr_s] = true;
        q.push({x.num + char(i + '0'), curr_s, curr_m});
      }
    }
  }
  cout << ans << '\n';
  return 0;
}
