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.Point;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;


public class N667 {
	static PrintWriter out;
	static Scanner sc;
	static ArrayList<Integer>q,w;
	static ArrayList<Integer>adj[];
	static HashSet<Integer>primesH;
	static boolean prime[];
	//static ArrayList<Integer>a;
	static HashSet<Long>h,tmp;
	static boolean[]v;
	static int[]a,b,c,d;
	static long[]l;
	static char[][]mp;
	static int A,B,n,m,k,mt[][];
	static int oo=Integer.MIN_VALUE;
	static int[][][][]dp;
	public static void main(String[]args) throws IOException {
		sc=new Scanner(System.in);
		out=new PrintWriter(System.out);
		A();
	//	B();
	//	C();
		//D();
		//E();
		//minimum for subarrays of fixed length
		//F();
		out.close();
	}
	  private static void A() throws IOException {
		  int t=ni();
			while(t-->0) {
				int a=sc.nextInt(),b=sc.nextInt();
				
				int diff=Math.abs(a-b);
				int num=diff/10;
				if(diff==0)out.println(0);
				else if(num==0) {
					out.println(1);
				}
				else {
					out.println((int)Math.ceil(diff/10.0));
				}
			}
		
	   }
		static void B() throws IOException {
			int t=ni();
			while(t-->0) {
				
				
						
			}
		}
	  static void C() throws IOException {
		  int t=ni();
		  while(t-->0) {
			  
		  }
		  
		}



	static void D() throws IOException {
		int t=ni();
		while(t-->0) {
			
		}
		
	}
	static int gcd (int a, int b) {
	    return b==0?a:gcd (b, a % b);
	}
	static int lcm (int a, int b) {
	    return a / gcd(a, b) * b;
	}
	static void E() throws IOException {
		int t=1;
		while(t-->0) {

			
		}
		
		
		
	}
	static void F() throws IOException{
		int t=1;
		while(t-->0) {
			
		}
		
	}

	static void G() throws IOException{
		int t=1;
		while(t-->0) {

			
			
			
		}
		
	}
	private static void disp(int[] revl) {
		for(int i=0;i<revl.length;i++) {
			out.print(revl[i]+" ");
		}
		out.println();
	}
	static class Pair implements Comparable<Pair>{
		int a,b,A,B;
		Pair(int a,int b,int A,int B){
			this.a=a;
			this.b=b;
			this.A=A;
			this.B=B;
		}
		@Override
		public int compareTo(Pair p) {
			int times1=(int)Math.ceil(b/(double)A);
			int ded1=a*times1;
			int x1=ded1-a;
			int times2=(int)Math.ceil(p.b/(double)A);
			int ded2=p.a*times2;
			int x2=ded2-p.a;
//			if(b%A==0)return 1;
//			if(p.b%A==0)return -1;
			return p.a==a?b-p.b:a-p.a;
//			return a-p.a;
//			return b-p.b;
		}
		public String toString() {
			return "("+a+" "+b+")";
		}
	}
	static int ni() throws IOException {
		return sc.nextInt();
	}
	static double nd() throws IOException {
		return sc.nextDouble();
	}
	static long nl() throws IOException {
		return  sc.nextLong();
	}
	static String ns() throws IOException {
		return sc.next();
	}
	static int[] nai(int n) throws IOException {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = sc.nextInt();
		return a;
	}
	static long[] nal(int n) throws IOException {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = sc.nextLong();
		return a;
	}
	static int[][] nmi(int n,int m) throws IOException{
		int[][]a=new int[n][m];
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				a[i][j]=sc.nextInt();
			}
		}
		return a;
	}

	static long[][] nml(int n,int m) throws IOException{
		long[][]a=new long[n][m];
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				a[i][j]=sc.nextLong();
			}
		}
		return a;
	}
	static void o(String x) {
		out.print(x);
	}
	static void ol(String x) {
		out.println(x);
	}
	static void ol(int x) {
		out.println(x);
	}
	static void disp1(int []a) {
		for(int i=0;i<a.length;i++) {
			out.print(a[i]+" ");
		}
		out.println();
	}
	static void disp2(Pair []a) {
		for(int i=0;i<a.length;i++) {
			out.print(a[i]+" ");
		}
		out.println();
	}
	static class Scanner 
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException 
		{
			while (st == null || !st.hasMoreTokens()) 
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public boolean hasNext() {return st.hasMoreTokens();}
		public int nextInt() throws IOException {return Integer.parseInt(next());}
		
		public double nextDouble() throws IOException {return Double.parseDouble(next());}
		
		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}
			
		public boolean ready() throws IOException {return br.ready(); }
		

	}
}
