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;
char used[500][5000];
struct st {
  int d, sum;
  string s;
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int d, sum;
  cin >> d >> sum;
  memset(used, 0, sizeof used);
  queue<st> q;
  q.push({0, 0, ""});
  while (q.size()) {
    st s = q.front();
    q.pop();
    if (s.d == 0 && s.sum == sum) {
      cout << s.s;
      cout << flush;
      return 0;
    }
    for (int i = 0; i < 10; ++i) {
      int td = (s.d * 10 + i) % d;
      int ts = s.sum + i;
      if (!used[td][ts] && ts <= sum) {
        used[td][ts] = 1;
        q.push({td, ts, s.s + char('0' + i)});
      }
    }
  }
  cout << -1;
  cout << flush;
  return 0;
}