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.*;
import java.io.*;

public class cf {

	public static void main(String[] args) throws IOException, InterruptedException {
		Scanner sc = new Scanner(System.in);
		int t=sc.nextInt();
		while(t-->0) {
			int a=sc.nextInt(),b=sc.nextInt();
			int x=Math.max(a,b)-Math.min(a,b);
			pw.println((long)Math.ceil(x/10.0));
		}
		pw.close();
	}

	static PrintWriter pw = new PrintWriter(System.out);

	public static class pair implements Comparable<pair> {
		int x;
		int y;

		public pair(int x, int y) {
			this.x = x;
			this.y = y;
		}

		public String toString() {
			return x + " " + y;
		}

		public boolean equals(Object o) {
			if (o instanceof pair) {
				pair p = (pair) o;
				return p.x == x && p.y == y;
			}
			return false;
		}

		public int hashCode() {
			return new Double(x).hashCode() * 31 + new Double(y).hashCode();
		}

		public int compareTo(pair other) {
			if (this.x == other.x) {
				return Long.compare(this.y, other.y);
			}
			return Long.compare(this.x, other.x);
		}
	}

	public static class tuble implements Comparable<tuble> {
		int x;
		int y;
		int z;

		public tuble(int x, int y, int z) {
			this.x = x;
			this.y = y;
			this.z = z;
		}

		public String toString() {
			return x + " " + y + " " + z;
		}

		public int compareTo(tuble other) {
			if (this.x == other.x) {
				if (this.y == other.y)
					return this.z - other.z;
				return this.y - other.y;
			} else {
				return this.x - other.x;
			}
		}
	}

	
	static class SegmentTree {
		int size;
		int[] st;

		public String toString() {
			return Arrays.toString(st);
		}

		void init(int n) {
			size = 1;
			while (size < n)
				size *= 2;
			st = new int[2 * size];
		}

		void build(int[] arr) {
			build(arr, 0, 0, size);
		}

		void build(int[] arr, int x, int lx, int rx) {
			if (rx - lx == 1) {
				if (lx < arr.length) {
					st[x] = arr[lx];
				}
				return;
			}
			int m = (lx + rx) >> 1;
			build(arr, 2 * x + 1, lx, m);
			build(arr, 2 * x + 2, m, rx);
			st[x] = st[2 * x + 1] + st[2 * x + 2];
		}

		void set(int i, int v) {
			set(i, v, 0, 0, size);
		}

		void set(int i, int v, int x, int l, int r) {
			if (r - l == 1) {
				st[x] = v;
				return;
			}
			int m = (l + r) >> 1;
			if (i < m) {
				set(i, v, 2 * x + 1, l, m);
			} else {
				set(i, v, 2 * x + 2, m, r);
			}
			st[x] = st[2 * x + 1] + st[2 * x + 2];
		}

		long get(int l, int r) {
			return get(l, r + 1, 0, 0, size);
		}

		long get(int l, int r, int x, int lx, int rx) {
			if (lx >= r || rx <= l) {
				return 0;
			} else if (lx >= l && rx <= r) {
				return st[x];
			}
			int m = (lx + rx) >> 1;
			return get(l, r, 2 * x + 1, lx, m) + get(l, r, 2 * x + 2, m, rx);
		}

		int find(int idx) {
			return find(idx, 0);
		}

		int find(int idx, int node) {
			if (node >= size - 1) {
				return node - size + 1;
			}
//			pw.print(node + " ");
			if (st[node * 2 + 1] > idx) {
				return find(idx, node * 2 + 1);
			} else {
				return find(idx - st[node * 2 + 1], node * 2 + 2);
			}
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

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

		public boolean hasNext() {
			// TODO Auto-generated method stub
			return false;
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

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

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

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

	}
}

