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;
int main() {
  int d, s;
  cin >> d >> s;
  queue<pair<pair<int, int>, string> > q;
  q.push(make_pair(make_pair(0, 0), ""));
  vector<vector<bool> > vis(d, vector<bool>(s + 2, false));
  vis[0][0] = true;
  string posta = "";
  while (!q.empty()) {
    pair<pair<int, int>, string> toy = q.front();
    q.pop();
    int sumaDig = toy.first.second;
    int modu = toy.first.first;
    if (modu == 0 && sumaDig == s) {
      posta = toy.second;
      break;
    }
    for (int i = 0; i < int(10); i++) {
      int num = modu * 10 + i;
      num %= d;
      int su = sumaDig + i;
      if (su > s) continue;
      if (vis[num][su]) continue;
      vis[num][su] = true;
      string nn = toy.second;
      nn += char(i + '0');
      q.push(make_pair(make_pair(num, su), nn));
    }
  }
  if (posta == "") {
    cout << -1 << endl;
  } else {
    cout << posta << endl;
  }
}