import java.io.*;
import java.util.*;

public class numbers_as_dumb implements Runnable {

    public void solve() throws IOException {
        Scanner in = new Scanner(new File("numbers.in"));
        PrintWriter out = new PrintWriter(new File("numbers.out"));

        while (true) {
            long n = in.nextLong();
            long k = in.nextLong();

            if (n == 0 && k == 0) {
                break;
            }

            String best = "" + k;

            for (long i = k; i <= n; i += k) {
                String t = "" + i;
                if (t.compareTo(best) < 0) {
                    best = t;
                }
            }


            out.println(best);
        }

        in.close();
        out.close();
    }

    public void run() {
        try {
            solve();
        } catch (IOException e) {
            System.exit(64);
        }
    }

    public static void main(String[] arg) throws IOException {
        new Thread(new numbers_as_dumb()).start();
    }
}
