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 mod = 1e9 + 7;
bool vis[501][5001];
int a, b;
void solve() {
  cin >> a >> b;
  queue<pair<pair<int, int>, string>> q;
  q.push({{0, 0}, ""});
  vis[0][0] = true;
  string res = "-1";
  while (!q.empty()) {
    int x, y;
    string s;
    pair<pair<int, int>, string> z = q.front();
    q.pop();
    x = z.first.first, y = z.first.second, s = z.second;
    if (x == 0 and y == b) {
      res = s;
      break;
    }
    for (int i = 0; i < 10; i++) {
      int aa = (x * 10 + i) % a;
      int bb = (y + i);
      if (bb <= b and !vis[aa][bb]) {
        q.push({{aa, bb}, s + char(i + '0')});
        vis[aa][bb] = true;
      }
    }
  }
  cout << res << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
