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 str {
  string st;
  int sum, r;
};
int main() {
  int d, s;
  cin >> d >> s;
  int i, j, l;
  int vis[d][s + 1];
  for (i = 0; i < d; i++)
    for (j = 0; j <= s; j++) vis[i][j] = 0;
  queue<str> q;
  str a;
  a.st = "";
  a.sum = 0;
  a.r = 0;
  q.push(a);
  while (!q.empty()) {
    str x = q.front();
    q.pop();
    if (x.sum == s && x.r == 0) {
      cout << x.st << endl;
      return 0;
    }
    str y;
    for (i = 0; i <= 9; i++) {
      string p = to_string(i);
      y.sum = x.sum + i;
      if (y.sum > s) break;
      y.r = (x.r * 10 + i) % d;
      if (vis[y.r][y.sum] == 0) {
        y.st = x.st + p;
        q.push(y);
        vis[y.r][y.sum] = 1;
      }
    }
  }
  cout << "-1" << endl;
  return 0;
}
