#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long double dist(long double x1, long double arayikhalatyan, long double x2,
                 long double y2) {
  return ((x1 - x2) * (x1 - x2) +
          (arayikhalatyan - y2) * (arayikhalatyan - y2));
}
char vow[] = {'a', 'e', 'i', 'o', 'u'};
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
const long long int N = 5010;
const long long int mod = 1e9 + 7;
const long double pi = acos(-1);
const int T = 150;
long long int bp(long long int a, long long int b = mod - 2LL) {
  long long int ret = 1;
  while (b) {
    if (b & 1) ret *= a, ret %= mod;
    a *= a;
    a %= mod;
    b >>= 1;
  }
  return ret;
}
int t, a, b;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  cin >> t;
  while (t--) {
    cin >> a >> b;
    if (a == b) cout << 0 << "\n";
    if (a > b) {
      if (a % 2 == b % 2)
        cout << 1 << "\n";
      else
        cout << 2 << "\n";
    } else if (a < b) {
      if (a % 2 == b % 2)
        cout << 2 << "\n";
      else
        cout << 1 << "\n";
    }
  }
  return 0;
}

### Prompt

Create a solution in cpp for the following problem:

You are given two positive integers a and b.

In one move, you can change a in the following way:

  * Choose any positive odd integer x (x > 0) and replace a with a+x; 
  * choose any positive even integer y (y > 0) and replace a with a-y. 



You can perform as many such operations as you want. You can choose the same numbers x and y in different moves.

Your task is to find the minimum number of moves required to obtain b from a. It is guaranteed that you can always 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 ≤ 10^4) — the number of test cases.

Then t test cases follow. Each test case is given as two space-separated 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 if you can perform any number of moves described in the problem statement. It is guaranteed that you can always obtain b from a.

Example

Input


5
2 3
10 10
2 4
7 4
9 3


Output


1
0
2
2
1

Note

In the first test case, you can just add 1.

In the second test case, you don't need to do anything.

In the third test case, you can add 1 two times.

In the fourth test case, you can subtract 4 and add 1.

In the fifth test case, you can just subtract 6.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long double dist(long double x1, long double arayikhalatyan, long double x2,
                 long double y2) {
  return ((x1 - x2) * (x1 - x2) +
          (arayikhalatyan - y2) * (arayikhalatyan - y2));
}
char vow[] = {'a', 'e', 'i', 'o', 'u'};
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
const long long int N = 5010;
const long long int mod = 1e9 + 7;
const long double pi = acos(-1);
const int T = 150;
long long int bp(long long int a, long long int b = mod - 2LL) {
  long long int ret = 1;
  while (b) {
    if (b & 1) ret *= a, ret %= mod;
    a *= a;
    a %= mod;
    b >>= 1;
  }
  return ret;
}
int t, a, b;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  cin >> t;
  while (t--) {
    cin >> a >> b;
    if (a == b) cout << 0 << "\n";
    if (a > b) {
      if (a % 2 == b % 2)
        cout << 1 << "\n";
      else
        cout << 2 << "\n";
    } else if (a < b) {
      if (a % 2 == b % 2)
        cout << 2 << "\n";
      else
        cout << 1 << "\n";
    }
  }
  return 0;
}

```