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;
int d, S;
bool vis[501][5001];
struct T {
  int first, second;
  string s;
  T(int xx, int yy, string ss) : first(xx), second(yy), s(ss) {}
};
queue<T> q;
int solve() {
  while (!q.empty()) q.pop();
  for (int i = 1; i < 10; ++i) {
    q.emplace(i % d, i, string(1, char(i + '0')));
    vis[i % d][i] = 1;
  }
  while (!q.empty()) {
    int first = q.front().first;
    int second = q.front().second;
    string s = q.front().s;
    q.pop();
    if (first == 0 && second == S) {
      cout << s << endl;
      return 0;
    }
    for (int i = 0; i < 10; ++i) {
      if (second + i > S) continue;
      int id = (first * 10 + i) % d;
      if (vis[id][second + i] == 0) {
        vis[id][second + i] = 1;
        q.emplace(id, second + i, s + char(i + '0'));
      }
    }
  }
  return 1;
}
int main() {
  cin >> d >> S;
  if (solve()) cout << "-1" << endl;
  return 0;
}
