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;
int d, s;
bool vis[505][5005];
struct state {
  int d, s;
  string cur;
  state(int d = 0, int s = 0, string cur = "") : d(d), s(s), cur(cur){};
};
void bfs() {
  cin >> d >> s;
  queue<state> q;
  q.push(state(0, 0, ""));
  vis[0][0] = true;
  while (not q.empty()) {
    state val = q.front();
    q.pop();
    if (val.s > s) continue;
    if (val.d == 0 and val.s == s) {
      cout << val.cur << "\n";
      return;
    }
    for (int i = 0; i < 10; i++) {
      int cur_d = (val.d * 10 + i) % d;
      int cur_s = val.s + i;
      if (!vis[cur_d][cur_s]) {
        vis[cur_d][cur_s] = true;
        q.push(state(cur_d, cur_s, val.cur + (char)(i + '0')));
      }
    }
  }
  cout << -1 << "\n";
}
int main() {
  bfs();
  return 0;
}
