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 long long INF = 0x3f3f3f3f3f3f3f3f;
const long long MAXN = 1e5 + 7;
const long long MAXM = 1e5 + 7;
const long long MOD = 1e9 + 7;
const double eps = 1e-6;
const double pi = acos(-1.0);
int vis[505][10005];
queue<pair<int, int> > q;
int d, s;
pair<int, int> p[505][10005];
int path[505][10005];
pair<int, int> pre[505][10005];
bool check(pair<int, int> x) {
  if (x.second > s || vis[x.first][x.second]) return false;
  return true;
}
void bfs() {
  vis[0][0] = 1;
  q.push(pair<int, int>(0, 0));
  while (!q.empty()) {
    pair<int, int> temp = q.front();
    q.pop();
    for (int i = 0; i <= 9; i++) {
      pair<int, int> tt = {(temp.first * 10 + i) % d, temp.second + i};
      if (check(tt)) {
        vis[tt.first][tt.second] = 1;
        p[tt.first][tt.second] = tt;
        path[tt.first][tt.second] = i;
        pre[tt.first][tt.second] = {temp.first, temp.second};
        q.push(tt);
      }
    }
  }
}
void Print(int D, int S) {
  if (!S && !D) return;
  Print(pre[D][S].first, pre[D][S].second);
  printf("%d", path[D][S]);
}
int main() {
  cin >> d >> s;
  bfs();
  if (!vis[0][s])
    printf("-1\n");
  else {
    Print(0, s);
    cout << endl;
  }
  return 0;
}
