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
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Collection;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.Queue;
import java.util.LinkedList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AFindANumber solver = new AFindANumber();
        solver.solve(1, in, out);
        out.close();
    }

    static class AFindANumber {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int d = in.nextInt(), s = in.nextInt();
            Queue<c> q = new LinkedList<>();
            boolean v[][] = new boolean[500][5001];
            q.add(new c(0, 0, new StringBuilder("")));
            v[0][0] = true;
            while (!q.isEmpty()) {
                c curr = q.poll();
                if (curr.r == 0 && curr.s == s) {
                    out.println(curr.ans);
                    return;
                }
                for (int i = 0; i < 10; i++) {
                    int rem = (10 * curr.r + i) % d;
                    int sum = curr.s + i;
                    if (sum < 5001 && !v[rem][sum]) {
                        v[rem][sum] = true;
                        StringBuilder s1 = new StringBuilder(curr.ans);
                        q.add(new c(rem, sum, s1.append(i)));
                    }
                }
            }
            out.println(-1);
        }

        class c {
            int r;
            int s;
            StringBuilder ans;

            public c(int r, int s, StringBuilder ans) {
                this.r = r;
                this.s = s;
                this.ans = ans;
            }

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

