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;
int d, s;
bool v[505][5005];
pair<int, int> dp[505][5005];
bool bfs() {
  queue<pair<int, int> > q;
  q.push({0, 0});
  v[0][0] = 1;
  while (!q.empty()) {
    pair<int, int> cur = q.front();
    q.pop();
    for (int i = 0; i <= 9; i++) {
      int mod = (cur.first * 10 + i) % d;
      int sum = cur.second + i;
      if (mod == 0 && sum == s) {
        dp[mod][sum] = {cur.first, cur.second};
        return 1;
      } else if (!v[mod][sum] && sum <= s) {
        dp[mod][sum] = {cur.first, cur.second};
        q.push({mod, sum});
        v[mod][sum] = 1;
      }
    }
  }
  return 0;
}
void print(int mod, int sum) {
  if (mod == 0 && sum == 0) {
    return;
  }
  print(dp[mod][sum].first, dp[mod][sum].second);
  cout << sum - dp[mod][sum].second;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> d >> s;
  if (bfs()) {
    print(0, s);
    cout << '\n';
  } else {
    puts("-1");
  }
  return 0;
}
