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.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {
    final static long MOD = 1000000007;

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        int t = fs.nextInt();

        while(t > 0) {
            t-=1;
            long a = fs.nextLong();
            long b = fs.nextLong();

            if(a==b) {
                out.println(0);
            } else if(a % 2 == 0 && b % 2 == 0) {
                if(a > b) {
                    out.println(1);
                } else {
                    out.println(2);
                }
            } else if(a % 2 == 1 && b % 2 == 1) {
                    if(a > b)
                        out.println(1);
                    else
                        out.println(2);
            } else {
                if(a > b) {
                    out.println(2);
                } else {
                    out.println(1);
                }
            }
        }

        out.flush();
        out.close();
    }

    public boolean isValidSudoku(char[][] board) {
        int [] hash = new int[9];
        boolean result = true;
        F : for(int type = 0; type < 3; type++) {
            if(type == 0) {
                for (int i = 0; i < board[0].length; i++) {
                    Arrays.fill(hash, 0);
                    for (int j = 0; j < board[0].length; j++) {
                        if (board[i][j] != '.') {
                            int cr = board[i][j] - '0';
                            if (hash[cr - 1] != 0) {
                                result = false;
                                break F;
                            } else {
                                hash[cr - 1] = 1;
                            }
                        }
                    }
                }
            }
            if(type == 1) {
                for (int i = 0; i < board[0].length; i++) {
                    Arrays.fill(hash, 0);
                    for (int j = 0; j < board[0].length; j++) {
                        if (board[j][i] != '.') {
                            int cr = board[j][i] - '0';
                            if (hash[cr - 1] != 0) {
                                result = false;
                                break F;
                            } else {
                                hash[cr - 1] = 1;
                            }
                        }
                    }
                }
            }
            if(type == 2) {
                for(int boxesrow = 0; boxesrow < 3; boxesrow++) {
                    for(int boxescol = 0; boxescol < 3; boxescol++) {
                        Arrays.fill(hash, 0);
                        for(int i = 0; i < 3; i++) {
                            for(int j = 0; j < 3; j++) {
                                if(board[(3*boxesrow)+i][(3*boxescol)+j] != '.') {
                                    int cr = board[(3*boxesrow)+i][(3*boxescol)+j] - '0';
                                    if (hash[cr - 1] != 0) {
                                        result = false;
                                        break F;
                                    } else {
                                        hash[cr - 1] = 1;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return result;
    }


    class Pair{
        int index;
        int val;

        Pair(int index, int val) {
            this.val = val;
            this.index = index;
        }
    }

    public static String rString(String s) {
        return new StringBuilder(s).reverse().toString();
    }

    public static int powoftwo(long n){
        int count = 0;
        while(n != 0) {
            n >>= 1;
            count++;
        }
        return count - 1;
    }

    public static void rotate(int[] nums, int k) {
        int n = nums.length;
        if(k > 0) {
            for(int j = 0; j < k; j++) {
                for (int i = 0; i < n; i++) {
                    int temp = nums[(i + k) % n];
                    nums[(i + k) % n] = nums[i];
                    nums[i] = temp;
                }
            }
        }
    }


    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                               // br = new BufferedReader(new FileReader("chat.txt"));
                st = new StringTokenizer("");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        public String next() {
            if (st.hasMoreTokens())
                return st.nextToken();
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            String line = "";
            try {
                line = br.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return line;
        }

        public char nextChar() {
            return next().charAt(0);
        }

        public Integer[] nextIntegerArray(int n) {
            Integer[] a = new Integer[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }

        public char[] nextCharArray() {
            return nextLine().toCharArray();
        }
    }

}

/*class Pair implements Comparable<Pair> {

    int V;
    int H;

    public Pair(int count, int val) {
        this.V = count;
        this.H = val;
    }

    public void setV(int v) {
        V = v;
    }

    public void setH(int h) {
        H = h;
    }

    @Override
    public int compareTo(Pair o) {
         if(this.V != o.V)
            return Integer.compare(this.V, o.V);
         else
             return Integer.compare(this.H, o.H);
    }

    public boolean equals(Pair o) {
        return this.H == o.H && this.V == o.V;
    }
}*/

class Pair {

    int V;
    int H;

    public Pair(int x, int y) {
        this.V = x;
        this.H = y;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Pair)) return false;
        Pair key = (Pair) o;
        return V == key.V && H == key.H;
    }

    @Override
    public int hashCode() {
        int result = V;
        result = 31 * result + H;
        return result;
    }

}


//check if operations are possible

//check how many cyclic shifts will take to put this element at it's rightful place

//for which cyclic shifts the operations are minimum

//do the same for the other columns
/*
4 1 1000000000 1
564924310 213333034 271576256 121705233*/
