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;
const int MAXN = 505;
const double EPS = 1e-8;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
int vis[MAXN][MAXN * 10], d, s;
struct Node {
  int mod;
  int s;
  string ans;
};
string bfs() {
  queue<Node> q;
  q.push({0, 0, ""});
  vis[0][0] = 1;
  while (!q.empty()) {
    Node t = q.front();
    q.pop();
    if (t.mod == 0 && t.s == s) return t.ans;
    for (int i = 0; i <= 9; i++) {
      int mod = (t.mod * 10 + i) % d, sum = t.s + i;
      if (sum <= s && !vis[mod][sum]) {
        vis[mod][sum] = 1;
        q.push({mod, sum, t.ans + (char)(i + '0')});
      }
    }
  }
  return "-1";
}
int main() {
  ios::sync_with_stdio(false);
  while (cin >> d >> s) {
    memset(vis, 0, sizeof(vis));
    cout << bfs() << endl;
  }
  return 0;
}
