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>
namespace remoon {
inline int read() {
  int p = 0, w = 1;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') p = p * 10 + c - '0', c = getchar();
  return p * w;
}
}  // namespace remoon
using namespace std;
using namespace remoon;
int d, s;
struct node {
  int d, s, di;
  node() {}
  node(int a, int b, int c) : d(a), s(b), di(c) {}
};
queue<pair<int, int> > q;
bool vis[525][5205];
node pre[525][5205];
void bfs() {
  vis[0][0] = 1;
  q.push(make_pair(0, 0));
  while (!q.empty()) {
    pair<int, int> p = q.front();
    q.pop();
    for (register int i = 0; i <= 9; i++) {
      int nd = (p.first * 10 + i) % d;
      int ns = p.second + i;
      if (ns > s) break;
      if (!vis[nd][ns]) {
        vis[nd][ns] = 1;
        q.push(make_pair(nd, ns));
        pre[nd][ns] = node(p.first, p.second, i + '0');
      }
    }
  }
}
inline void dfs(int nd, int ns) {
  if (pre[nd][ns].di != 0) dfs(pre[nd][ns].d, pre[nd][ns].s);
  if (pre[nd][ns].di != 0) printf("%c", pre[nd][ns].di);
}
int main() {
  d = read();
  s = read();
  bfs();
  if (!vis[0][s])
    puts("-1");
  else
    dfs(0, s);
  return 0;
}
