Problem: 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

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
void File() {}
int vis[501][5010] = {0};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  File();
  int d, sum;
  cin >> d >> sum;
  map<string, pair<int, int>> mp;
  queue<pair<pair<int, int>, string>> q;
  for (int i = 1; i < 10; i++) {
    q.push({{i % d, i}, string(1, '0' + i)});
    vis[i % d][i] = 1;
  }
  while (q.size()) {
    int md = q.front().first.first;
    int sm = q.front().first.second;
    string cur = q.front().second;
    q.pop();
    if (!md && sm == sum) return cout << cur << "\n", 0;
    if (sm > sum) continue;
    if (cur.size() == 5001) break;
    for (int i = 0; i < 10; i++) {
      int nmd = (md * 10) + i;
      nmd %= d;
      int nsm = sm + i;
      if (!vis[nmd][nsm]) {
        vis[nmd][nsm] = 1;
        q.push({{nmd, nsm}, cur + string(1, i + '0')});
      }
    }
  }
  cout << -1 << "\n";
  return 0;
}