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;
long long d, s;
long long visited[501][5001];
struct node {
  long long sum, mod;
  string st;
};
void bfs() {
  queue<node> q;
  q.push({0, 0, ""});
  visited[0][0] = 1;
  while (!q.empty()) {
    node T = q.front();
    q.pop();
    if (T.sum > s) continue;
    if (T.mod == 0 && T.sum == s) {
      cout << T.st;
      return;
    }
    for (long long i = 0; i <= 9; i++) {
      long long dd = (T.mod * 10 + i) % d;
      long long ss = T.sum + i;
      if (ss <= s && !visited[dd][ss]) {
        visited[dd][ss] = 1;
        q.push({ss, dd, T.st + char(i + '0')});
      }
    }
  }
  cout << -1;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> d >> s;
  bfs();
}
