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 Num {
  int mod;
  int sum;
  string tviton;
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int d, s;
  cin >> d >> s;
  string res = "-1";
  vector<vector<bool>> used(505);
  for (int i = 0; i < 505; i++) {
    vector<bool> cur(5005, false);
    used[i] = cur;
  }
  queue<Num> q;
  Num start;
  start.mod = start.sum = 0;
  start.tviton = "";
  q.push(start);
  used[0][0] = true;
  while (!q.empty()) {
    Num cur = q.front();
    q.pop();
    if (cur.sum > s) continue;
    if (cur.mod == 0 && cur.sum == s) {
      res = cur.tviton;
      break;
    }
    for (int i = 0; i <= 9; i++) {
      Num axla;
      axla.mod = (10 * cur.mod + i) % d;
      axla.sum = cur.sum + i;
      if (!used[axla.mod][axla.sum]) {
        axla.tviton = cur.tviton + char(i + '0');
        q.push(axla);
        used[axla.mod][axla.sum] = true;
      }
    }
  }
  cout << res << endl;
  return 0;
}