You are given two integers a and b.

In one move, you can choose some integer k from 1 to 10 and add it to a or subtract it from a. In other words, you choose an integer k ∈ [1; 10] and perform a := a + k or a := a - k. You may use different values of k in different moves.

Your task is to find the minimum number of moves required to obtain b from a.

You have to answer t independent test cases.

Input

The first line of the input contains one integer t (1 ≤ t ≤ 2 ⋅ 10^4) — the number of test cases. Then t test cases follow.

The only line of the test case contains two integers a and b (1 ≤ a, b ≤ 10^9).

Output

For each test case, print the answer: the minimum number of moves required to obtain b from a.

Example

Input


6
5 5
13 42
18 4
1337 420
123456789 1000000000
100500 9000


Output


0
3
2
92
87654322
9150

Note

In the first test case of the example, you don't need to do anything.

In the second test case of the example, the following sequence of moves can be applied: 13 → 23 → 32 → 42 (add 10, add 9, add 10).

In the third test case of the example, the following sequence of moves can be applied: 18 → 10 → 4 (subtract 8, subtract 6).
from math import ceil


def map_input(type=1):
    if type == 1:
        return map(int, input().split())
    elif type == 2:
        return map(float, input().split())
    elif type == 3:
        return map(str, input().split())
    return None


def list_input(type=1):
    return list(map_input(type))


def give_excel_column_name(r: int):
    l = 1
    r -= 1
    ans: str = ""
    while 26**l <= r:
        r -= 26**l
        l += 1
    while l > 0:
        ans += (chr(ord('A') + r//26**(l-1) % 26))
        l -= 1
    return ans


def give_excel_column_number(name: str):
    p = 1
    ans: int = 0
    for j in range(len(name)):
        ans = ans + p * ((ord(name[j]) - ord('A')) + 1)
        p = p * 26
    return ans


def sorted_indices(s):
    li = []
    for i in range(len(s)):
        li.append([s[i], i])
    li.sort()
    return [x[1] for x in li]

# https://www.geeksforgeeks.org/floor-in-a-sorted-array/


def floorSearch(arr, x, low=-1, high=-1):
    if low == -1:
        low = 0
    if high == -1:
        high == len(arr) - 1
    if (low > high):
        return -1
    if (x >= arr[high]):
        return high
    mid = int((low + high) / 2)
    if (arr[mid] == x):
        return mid
    if (mid > 0 and arr[mid-1] <= x
            and x < arr[mid]):
        return mid - 1
    if (x < arr[mid]):
        return floorSearch(arr, low, mid-1, x)
    return floorSearch(arr, mid + 1, high, x)


def find_index(arr, x):
    low = 0
    high = len(arr) - 1
    mid = 0
    while low <= high:
        mid = (high + low) // 2
        if arr[mid] < x:
            low = mid + 1
        elif arr[mid] > x:
            high = mid - 1
        else:
            return mid
    return -1


def floyd_warshell(g):
    n = len(g)
    d = g.copy()
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j], d[i][k] + d[k][j])
    return d


def int_input(type=1):
    if type == 1:
        return int(input())
    elif type == 2:
        return float(int(input()))


def range_input():
    return range(int_input())


def gcd(x, y):
    while(y):
        x, y = y, x % y
    return x


def main():
    for _ in range_input():
        a, b = map_input()
        print(ceil(abs(a-b)/10))


if __name__ == "__main__":
    try:
        main()
    except:
        pass
