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.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.ArrayList;
import java.util.List;

/**
 * Yet another two integer problem Given a and b, we can select any number from
 * 1 to 10 and add or subtract from a and find the minimum number of moves to
 * get b
 * 
 * @author subash
 *
 */
public class SolutionAA {

	public static void main(String args[]) {

		FastScanner in = new FastScanner();
		PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

		int tests = in.nextInt();
		List<Integer>[] al = new ArrayList[tests];

		// Get input data and save in list array
		for (int cases = 0; cases < tests; cases++) {
			int a = in.nextInt();
			int b = in.nextInt();
			List<Integer> testCase = new ArrayList<Integer>();
			testCase.add(a);
			testCase.add(b);
			al[cases] = testCase;
		}

		// Loop each test case and print the result
		for (int cases = 0; cases < al.length; cases++) {
			int a = al[cases].get(0);
			int b = al[cases].get(1);
			int diffA = a;
			// int minStep = 0;
			int diffA1 = 0;
//            int diffA2 = 0;
//            int diffA3 = 0;
//            int diffA4 = 0;
			if (a != b) {
				int dif = Math.abs(a - b);
				diffA1 = dif / 10;
				if (dif % 10 == 0) {
					//if(a>b) {
						diffA1 = dif/10;
					//}else {
						//diffA1 = dif;
					//s}
					

				} else {
					diffA1++;
				}
//				if (dif > 10) {
//					diffA1 = dif / 10;
//					//System.out.println(diffA1);
//					diffA1++;
//				} else {
//					diffA1 = 1;
//					// Over
//				}
				// 100500 9000

			}
			System.out.println(diffA1);
			// 13 42 42 13
			// 42-13 = 29 diffA
			// 29/10 = 2 diffA1
			// 2*10 = 20
			// 13+20 = 33
			// 42-33 = 9
			// 2+1 = 3

//            
//    		while(diffA!=b) {
//    			minStep++;
//    			diffA = equalizeInt(diffA,b);
//    		}
//    		System.out.println(minStep);

		}

	}

	/**
	 * This method is the main method which will equalize a and b from taking a
	 * value from 1 to 10 and do the add or sub operation
	 * 
	 * @param a
	 * @param b
	 * @return
	 */
//	public static int equalizeInt(int a, int b) {
//
//			// Find the difference, if the diff is higher than 10, then take 10 or else take
//			// what ever it return
//			int difference = Math.abs(a - b);
//			if (difference >= 10) {
//				if (a < b) {
//					a = a + 10;
//				} else {
//					a = a - 10;
//				}
//
//			} else {
//				if (a < b) {
//					a = a + difference;
//				} else {
//					a = a - difference;
//				}
//
//			}
//		return a;
//	}

	/* Fast Input reader */
	static class FastScanner {
		BufferedReader reader;
		StreamTokenizer tokenizer;

		public FastScanner() {
			reader = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = new StreamTokenizer(reader);
			tokenizer.resetSyntax();
			tokenizer.whitespaceChars(0, 32);
			tokenizer.wordChars(33, 126);
		}

		private void nextToken() {
			try {
				tokenizer.nextToken();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

		String next() {
			nextToken();
			return tokenizer.sval;
		}

		int nextInt() {
			nextToken();
			return Integer.parseInt(tokenizer.sval);
		}

		long nextLong() {
			nextToken();
			return Long.parseLong(tokenizer.sval);
		}

		double nextDouble() {
			nextToken();
			return Double.parseDouble(tokenizer.sval);
		}

		String nextLine() {
			try {
				String string = reader.readLine();
				return string;
			} catch (Exception e) {
				e.printStackTrace();
				return "";
			}
		}
	}

}
