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;
bool p[501][5001];
struct state {
  int d, sum;
  string s;
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int i, j, k, m, n, d0, nd, mod, d, sum, nsum, sum0;
  string s;
  cin >> mod >> sum0;
  queue<state> q;
  q.push({0, 0, ""});
  p[0][0] = 1;
  while (!q.empty()) {
    d = q.front().d;
    sum = q.front().sum;
    s = q.front().s + ' ';
    q.pop();
    if (d == 0 && sum == sum0) {
      cout << s;
      return 0;
    }
    for (i = 0; i <= 9; i++) {
      nd = (d * 10 + i) % mod;
      nsum = sum + i;
      if (p[nd][nsum] == 0 && nsum <= sum0) {
        p[nd][nsum] = 1;
        s[s.size() - 1] = '0' + i;
        q.push({nd, nsum, s});
      }
    }
  }
  cout << -1;
  return 0;
}
