J. Problem Name
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Abdelaleem has an integer $$$x$$$, yet he accidentally encounters the digit $$$d$$$. Fortunately, he has the ability to increment $$$x$$$ by one in a single operation ($$$x:= x + 1$$$). Could you assist him in determining the minimum number of operations required to ensure that $$$n$$$ no longer contains the digit $$$d$$$?

Input

The first line contains an integer $$$T$$$ – the number of test cases.

For each test case:

The first line contains two integers $$$x$$$, and $$$d$$$ ($$$0 \leq d \leq 9$$$)($$$1 \leq x \leq 10^9$$$).

Output

For each test case, output on a single line the minimum number of operations required to ensure that $$$n$$$ no longer contains the digit $$$d$$$.

Example
Input
4
21 5
8 8
100 0
484300 3
Output
0
1
11
100