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;
int d, s;
struct node {
  int num, sum;
};
struct pre {
  int num, sum, x;
};
int vis[501][5001];
pre p[501][5001];
queue<node> q;
bool check(int num, int sum) {
  if (!vis[num][sum] && sum <= s) return 1;
  return 0;
}
void bfs() {
  vis[0][0] = 1;
  node t;
  t.num = 0;
  t.sum = 0;
  q.push(t);
  while (!q.empty()) {
    node tmp = q.front();
    q.pop();
    int num = tmp.num, sum = tmp.sum;
    for (int i = 0; i <= 9; i++) {
      int new_num = (10 * num + i) % d, new_sum = sum + i;
      if (check(new_num, new_sum)) {
        vis[new_num][new_sum] = 1;
        node tp;
        tp.num = new_num;
        tp.sum = new_sum;
        pre temp;
        temp.num = num;
        temp.sum = sum;
        temp.x = i;
        p[new_num][new_sum] = temp;
        q.push(tp);
      }
    }
  }
}
void print(int dd, int ss) {
  if (ss == 0) return;
  print(p[dd][ss].num, p[dd][ss].sum);
  cout << p[dd][ss].x;
}
int main() {
  cin >> d >> s;
  bfs();
  if (!vis[0][s])
    cout << -1 << endl;
  else
    print(0, s);
  return 0;
}