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;
const long long modn = 998244353;
const int INF = 0x3f3f3f3f;
struct pii {
  int sum;
  int md;
};
int dp[5050][505][2];
int d, s;
void prt(int sum, int md) {
  if (sum) {
    prt(dp[sum][md][0], dp[sum][md][1]);
    cout << sum - dp[sum][md][0];
  }
}
int main() {
  memset(dp, 0x3f, sizeof dp);
  cin >> d >> s;
  queue<pii> q;
  dp[0][0][0] = dp[0][0][1] = 0;
  q.push(pii{0, 0});
  while (!q.empty()) {
    pii t = q.front();
    q.pop();
    for (int i = 0; i < 10; i++) {
      pii nextp;
      nextp.sum = t.sum + i;
      nextp.md = (t.md * 10 + i) % d;
      if (nextp.sum > s) break;
      if (dp[nextp.sum][nextp.md][0] == INF) {
        dp[nextp.sum][nextp.md][0] = t.sum;
        dp[nextp.sum][nextp.md][1] = t.md;
        q.push(nextp);
      }
    }
  }
  if (dp[s][0][0] == INF) {
    cout << -1 << endl;
  } else {
    prt(s, 0);
    cout << endl;
  }
  return 0;
}
