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 vis[805][8005];
int pre[505][5005];
struct node {
  int yu, sum;
  string s;
  node() {}
  node(int yu, int sum, string s) : yu(yu), sum(sum), s(s) {}
};
int d, ss;
void bfs() {
  queue<node> q;
  q.push(node(0, 0, ""));
  vis[0][0] = 1;
  while (!q.empty()) {
    node now = q.front();
    q.pop();
    int yu1 = now.yu;
    int sum1 = now.sum;
    string s = now.s;
    if (yu1 == 0 && sum1 == ss) {
      cout << now.s;
      return;
    }
    if (sum1 > ss) continue;
    for (int i = 0; i <= 9; i++) {
      int t1 = (yu1 * 10 + i) % d;
      int t2 = sum1 + i;
      if (vis[t1][t2]) continue;
      vis[t1][t2] = 1;
      node nxt = node(t1, t2, s + (char)(i + '0'));
      q.push(nxt);
    }
  }
  puts("-1");
  return;
}
int main() {
  cin >> d >> ss;
  bfs();
}
