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>
#pragma GCC optimize(2)
using namespace std;
void qread(int &x) {
  int neg = 1;
  x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') neg = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = 10 * x + c - '0', c = getchar();
  x *= neg;
}
const int maxn = 505;
const int maxm = 5005;
int d, n;
bool dp[maxn][maxm];
pair<int, int> prv[maxn][maxm];
queue<pair<int, int> > q;
void update(int i1, int j1, int i2, int j2) {
  if (j2 > n) return;
  if (!dp[i2][j2]) {
    dp[i2][j2] = true;
    q.push(make_pair(i2, j2));
    prv[i2][j2] = make_pair(i1, j1);
  }
}
int main() {
  scanf("%d%d", &d, &n);
  update(-1, -1, 0, 0);
  while (!q.empty()) {
    int i = q.front().first, j = q.front().second;
    q.pop();
    if (i == 0 && j == n) {
      string cur = "";
      while (i || j) {
        pair<int, int> tmp = prv[i][j];
        cur += char('0' + j - tmp.second);
        i = tmp.first;
        j = tmp.second;
      }
      reverse(cur.begin(), cur.end());
      printf("%s\n", cur.c_str());
      return 0;
    }
    for (int(c) = 0; (c) < 10; c++) {
      update(i, j, (i * 10 + c) % d, j + c);
    }
  }
  puts("-1");
  return 0;
}
