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>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
using namespace std;
long long vis[600][5000];
pair<long long, long long> par[600][5000];
void print(pair<long long, long long> p) {
  if (p.first == 0 && p.second == 0) return;
  print(par[p.first][p.second]);
  cout << p.second - par[p.first][p.second].second;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long d, s;
  cin >> d >> s;
  memset(vis, 0, sizeof(vis));
  queue<pair<long long, long long>> q;
  q.push({0, 0});
  vis[0][0] = 1;
  bool ch = 0;
  while (!q.empty()) {
    pair<long long, long long> p = q.front();
    long long rem = p.first;
    long long sum = p.second;
    q.pop();
    if (rem == 0 && sum == s) {
      print(p);
      ch = 1;
      break;
    }
    for (long long i = 0; i <= 9; i++) {
      long long r = (rem * 10 + i) % d;
      if (vis[r][sum + i] == 0 && sum + i <= s) {
        q.push({r, sum + i});
        vis[r][sum + i] = 1;
        par[r][sum + i] = p;
      }
    }
  }
  if (!ch) cout << -1;
  return 0;
}