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 D = 510;
const int S = 5010;
int d, s;
int vis[D][S];
pair<pair<int, int>, int> p[D][S];
void bfs() {
  queue<pair<int, int> > q;
  q.push({0, 0});
  while (!q.empty()) {
    int x = q.front().first;
    int y = q.front().second;
    q.pop();
    for (int i = 0; i < 10; i++) {
      int dx = (x * 10 + i) % d;
      int dy = (y + i);
      if (dy <= s && !vis[dx][dy]) {
        vis[dx][dy] = 1;
        p[dx][dy] = make_pair(make_pair(x, y), i);
        q.push(make_pair(dx, dy));
      }
    }
  }
}
void print(int x, int y) {
  if (!x && !y) return;
  print(p[x][y].first.first, p[x][y].first.second);
  putchar('0' + p[x][y].second);
}
int main() {
  scanf("%d%d", &d, &s);
  bfs();
  if (!vis[0][s])
    puts("-1");
  else
    print(0, s);
  return 0;
}
