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 d, s;
  string ans;
};
bool vis[510][5010];
void solve() {
  int d, s;
  scanf("%d%d", &d, &s);
  memset(vis, 0, sizeof vis);
  queue<node> q;
  node now;
  q.push(node{0, 0, ""});
  vis[0][0] = 1;
  q.push(now);
  while (!q.empty()) {
    now = q.front();
    q.pop();
    if (now.d == 0 && now.s == s) {
      puts(now.ans.c_str());
      return;
    }
    for (int i = 0; i <= 9; i++) {
      int dd = now.d * 10 + i;
      dd %= d;
      int ss = now.s + i;
      if (ss <= s && !vis[dd][ss]) {
        vis[dd][ss] = 1;
        q.push(node{dd, ss, now.ans + char(i + '0')});
      }
    }
  }
  puts("-1");
}
int main() {
  solve();
  return 0;
}