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.util.*;
public class Power {
    static long power(int a,int b){
        if(b==0)
            return 1;
        long pow=power(a,b/2);
        if(b%2!=0){
            return pow*pow*a;
        }
        else{
            return pow*pow;
        }
    }
    static long gcd(long a,long b){
        if(b==0)
            return a;
        else 
            return gcd(b,b%a);
    }
    static long lcm(long a,long b){
        return (a*b)/gcd(a,b);
    }
    static List<Integer> primes(int n){
            List<Integer> list=new ArrayList<Integer>();
            boolean[] prime=new boolean[n+1];
            Arrays.fill(prime,true);
            prime[0]=false;
            prime[1]=false;
            int sqrt=(int)Math.sqrt(n);
            for(int i=2;i<=sqrt;i++){
                if(prime[i]){
                    for(int j=i*i;j<=n;j=j+i){
                        prime[j]=false;
                    }
                }
            }
            for(int i=0;i<prime.length;i++){
                if(prime[i])
                    list.add(i);
            }
            return list;
    }
    static long catalan(long n){
            long result=0;
            if(n<=1)
                return 1;
            for(long i=0;i<n;i++)
                result+=catalan(i)*catalan(n-i-1);
            return result;
    }
    static long totient(long n){
        long res=0;
        for(long i=1;i<=n;i++){
            if(gcd(i,n)==1)
                res++;
        }
        return res;
        
    }
   /* static double ternarysearch(long low,long high,long[] a,long[] b,long result){
        int t=500;
        while(t-->0 ){
            long m1=low+(high-low)/3;
            long m2=high-(high-low)/3;
            long v1=ft(m1,a,b);
           long v2=ft(m2,a,b);
            result=Math.min(result,Math.min(v1,v2));
            if(v1<result)
                result=v1;
            if(v2<result)
                result=v2;
            if(v1<v2){
                high=m2;
            }
            else
                low=m1;
        }
            for(long i=low;i<=high;i++){
              //  if(ft(i,a,b)<result)
                //    result=ft(i,a,b);
            }
        return result;
    }*/
    static int countone(Integer[] one,int low,int high){
        if(low<=high){
            int mid=(low+high)/2;
            if((mid==high || one[mid+1]==0) && one[mid]==1)
                return mid+1;
            if(one[mid]==1){
                return countone(one,mid+1,high);
            }
            else{
                return countone(one,low,mid-1);
            }
        
        }
        return 0;

    }
   
   
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        int test=input.nextInt();
        input.nextLine();
        while(test-->0){
         int a=input.nextInt();
         int b=input.nextInt();
         if(a==b){
             System.out.println("0");
         }
         else if(a<b){
             if((b-a)%2==0){
                 System.out.println("2");
             }
             else{
                 System.out.println("1");
             }

         }
         else if(a>b){
            if((a-b)%2==1){
                System.out.println("2");
            }
            else{
                System.out.println("1");
            }
         }

        }
        }
}