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[555][5555];
struct node {
  node(){};
  int sum, mod;
  string ans;
  node(int _sum, int _mod, string _ans) : sum(_sum), mod(_mod), ans(_ans){};
};
string bfs(int d, int s) {
  queue<node> q;
  q.push(node(0, 0, ""));
  vis[0][0] = 1;
  while (!q.empty()) {
    node tmp = q.front();
    q.pop();
    if (tmp.sum == s && tmp.mod == 0) return tmp.ans;
    for (int i = 0; i <= 9; ++i) {
      if (tmp.sum + i <= s) {
        int sumnew = tmp.sum + i;
        int modnew = (tmp.mod * 10 + i) % d;
        if (!vis[modnew][sumnew]) {
          vis[modnew][sumnew] = 1;
          q.push(node(sumnew, modnew, tmp.ans + (char)(i + '0')));
        }
      }
    }
  }
  return "-1";
}
int main() {
  int d, s;
  cin >> d >> s;
  cout << bfs(d, s) << endl;
  return 0;
}
