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).

import java.awt.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
import java.util.List;

/**
 * Codeforces
 * 
 * 
 */
public class Codeforcess {

    public static boolean has1inbetween(String s, int i, int j) {
        boolean ans = true;
        char ch[] = s.toCharArray();

        for (int b = i + 1; b < j && b < s.length() && i < ch.length && j < ch.length; b++) {
            if (ch[i] == '1') {
                ans = false;
            }
        }
        return ans;
    }

    public static int segregate(int arr[], int size) {
        int j = 0, i;
        for (i = 0; i < size; i++) {
            if (arr[i] <= 0) {
                int temp;
                temp = arr[i];
                arr[i] = arr[j];
                arr[j] = temp;
                // increment count of non-positive
                // integers
                j++;
            }
        }

        return j;
    }

    public static long lowComMultiple(long a, long b) {
        long min = a * b;
        long start = Math.min(a, b);
        long ans = -1;
        for (int i = (int) start; i <= min; i++) {
            if (i % a == 0 && i % b == 0) {
                ans = i;
                break;
            }
        }
        return ans;
    }

    public static int solution(int[] A) {
        int n = A.length;

        // To mark the occurrence of elements
        boolean[] present = new boolean[n + 1];

        // Mark the occurrences
        for (int i = 0; i < n; i++) {

            if (A[i] > 0 && A[i] <= n)
                present[A[i]] = true;
        }

        // Find the first element which didn't
        // appear in the original array
        for (int i = 1; i <= n; i++)
            if (!present[i])
                return i;

        return n + 1;
    }

    public static ArrayList<Long> digit(long num) {
        long dig = 0;
        // long length = 0;
        ArrayList<Long> digi = new ArrayList<>();
        while (num > 0) {
            dig = num % 10;
            digi.add(dig);
            num = num / 10;

        }
        // return dig; //System.out.printf("%d", +revnum);

        return digi;
    }

    static int[] shuffle(int a[], int n) {
        for (int i = 0; i < n; i++) {

            // getting the random index
            int t = (int) Math.random() * a.length;

            // and swapping values a random index
            // with the current index
            int x = a[t];
            a[t] = a[i];
            a[i] = x;
        }
        return a;
    }

    public void dump() {

    }

    public static long addDigits(long num) {
        long digit = 0;
        // long sum = 0;
        long dig = -1;

        while (num != 0) {
            digit = num % 10;
            dig = digit;
            num = num / 10;
            break;
        }
        return dig;
    }

    public static int addDigit(long num) {
        long digit = 0;
        // long sum = 0;
        int count = 0;

        while (num != 0) {
            digit = num % 10;
            count++;
            num = num / 10;

        }
        return count;
    }

    public static class Pair<A, B> {
        private A first;
        private B second;

        public Pair(A first, B second) {
            this.first = first;
            this.second = second;
        }

        public A getFirst() {
            return first;
        }

        public B getSecond() {
            return second;
        }

        public void setFirst(A first) {
            this.first = first;
        }

        public void setSecond(B second) {
            this.second = second;
        }
    }

    static void findPair(int values[], int n, Pair<Integer, Integer> ans) {
        // Pair<Integer, Integer> ans = new Pair<Integer,Integer>(0, 0);
        int size = values.length;
        int i = 0, j = 1;
        int minLen = Integer.MAX_VALUE;
        int in = -1;
        int jn = -1;
        while (i < size && j < size) {

            if (i != j && values[j] - values[i] == n) {

                if (j - i < minLen) {
                    in = i;
                    jn = j;
                }
                break;
                // System.out.print("Pair Found: " + "( " + values[i] + ", " + values[j] + "
                // )");
                // return "1";
            } else if (values[j] - values[i] < n)
                j++;
            else
                i++;
        }

        if (in == -1 && jn == -1) {
            ans.setFirst(-1);
            ans.setSecond(-1);
        } else {
            ans.setFirst(in + 1);
            ans.setSecond(jn + 1);
        }

        // return ans;
    }

    public static String findMinDays(int[] values, int[] profit) {

        StringBuilder str = new StringBuilder();
        ArrayList<Pair<Integer, Integer>> ans = new ArrayList<>();
        Pair<Integer, Integer> p = new Pair<Integer, Integer>(0, 0);
        for (int i = 0; i < profit.length; i++) {
            findPair(values, profit[i], p);
            ans.add(p);
        }

        for (int i = 0; i < ans.size(); i++) {
            if (ans.get(i).getFirst() != -1 || ans.get(i).getSecond() != -1) {
                str.append(ans.get(i).getFirst());
                str.append(" ");
                str.append(ans.get(i).getSecond() + ",");
            } else {
                str.append(-1 + ",");
            }
        }

        String s;
        str.setCharAt(str.length() - 1, ' ');
        s = str.toString();
        return s;

    }

    public static long fact(long n) {
        long res = 1;
        for (long i = 2; i <= n; i++)
            res = res * i;
        return res;
    }

    public static long nCr(long n, long r) {
        return fact(n) / (fact(r) * fact(n - r));
    }

    public static void main(String[] args) {

        try {
            // InputStreamReader isr = new InputStreamReader(System.in);
            // BufferedReader br = new BufferedReader(isr);
            // Scanner sc = new Scanner(System.in);
            // int m = 1000000007;
            // int n = sc.nextInt();
            // int x = sc.nextInt();
            // int pos = sc.nextInt();
            // boolean boo = false;
            // int cSmall = 0;
            // int cBig = 0;

            // int left = 0;
            // int right = n;
            // while (left < right) {
            // int middle = (left + right) / 2;
            // if (middle > pos)
            // cBig++;
            // else if (middle < pos)
            // cSmall++;
            // if (middle <= pos) {
            // left = middle + 1;
            // } else {
            // right = middle;
            // }

            // // if (left > 0 && left - 1 == pos) {
            // // boo = true;
            // // } else
            // // boo = false;

            // }
            // left = pos + 1;
            // System.out.println(nCr(x - 1, cSmall) % m * nCr(n - x, cBig) % m * fact(n -
            // cSmall - cBig - 1) % m
            // * fact(cSmall) % m * fact(cBig) % m);
            Scanner sc = new Scanner(System.in);
            int t = sc.nextInt();
            while (t-- > 0) {
                int a = sc.nextInt();
                int b = sc.nextInt();

                int diff = Math.abs(a - b);
                int ans = 0;
                // if (diff % 10 > 0) {
                // ans = diff / 10;
                // ans = ans + 1;
                // } else if (diff > 10 && diff % 10 == 0) {
                // ans = diff / 10;

                // }
                ans = (diff + 9) / 10;

                System.out.println(ans);
            }
        } catch (Exception e) {
            System.out.println(e);
        }

    }

}