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 \le t \le 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 \le a, b \le 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$.
[{"code": "for _ in range(int(input())):\n    a, b = list(map(int, input().split()))\n    if a == b:\n        print(0)\n    else:\n        if a < b:\n            if (b - a) % 2:\n                print(1)\n            else:\n                print(2)\n        else:\n            if (b - a) % 2 == 0:\n                print(1)\n            else:\n                print(2)\n", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "import sys\n\ndef fast_input():\n    return sys.stdin.readline().strip()\n\ndef data_input():\n    return [int(x) for x in fast_input().split()]\n\ndef binary_search(array, x):\n    left, right = -1, len(array)\n    while left + 1 != right:\n        middle = (left + right) // 2\n        if array[middle] >= x:\n            right = middle\n        elif array[middle] < x:\n            left = middle\n    return right\n\ndef solve_of_problem():\n    a, b = data_input()\n    if (b - a) % 2 == 1 and a < b:\n        print(1)\n    elif (b - a) % 2 == 0 and b < a:\n        print(1)\n    elif a == b:\n        print(0)\n    else:\n        print(2)\n    return\n\nfor ______ in range(int(fast_input())):\n    solve_of_problem()", "passed": true, "time": 0.14, "memory": 14416.0, "status": "done"}, {"code": "q = int(input())\nfor wrere in range(q):\n\ta,b = map(int,input().split())\n\tif a<b:\n\t\tif (a-b)%2 == 1:\n\t\t\tprint(1)\n\t\telse:\n\t\t\tprint(2)\n\telse:\n\t\tif a == b:\n\t\t\tprint(0)\n\t\telse:\n\t\t\tif (a-b)%2 == 0:\n\t\t\t\tprint(1)\n\t\t\telse:\n\t\t\t\tprint(2)", "passed": true, "time": 0.15, "memory": 14344.0, "status": "done"}, {"code": "for nt in range(int(input())):\n\ta,b=map(int,input().split())\n\tif b==a:\n\t\tprint (0)\n\t\tcontinue\n\tif b>a:\n\t\tif (b-a)%2==1:\n\t\t\tprint (1)\n\t\t\tcontinue\n\t\telse:\n\t\t\tprint (2)\n\t\t\tcontinue\n\telse:\n\t\tif (a-b)%2==0:\n\t\t\tprint (1)\n\t\t\tcontinue\n\t\telse:\n\t\t\tprint (2)", "passed": true, "time": 0.14, "memory": 14380.0, "status": "done"}, {"code": "t = int(input())\nfor z in range(t):\n\ta,b = list(map(int,input().split()))\n\tans = 0\n\tif a>b:\n\t\tif (a-b)%2 == 0:\n\t\t\tans = 1\n\t\telse:\n\t\t\tans = 2\n\telif a<b:\n\t\tif (b-a)%2 == 0:\n\t\t\tans = 2\n\t\telse:\n\t\t\tans = 1\n\tprint(ans)\n", "passed": true, "time": 0.15, "memory": 14148.0, "status": "done"}, {"code": "from sys import stdin\n\n\ndef solve():\n    a, b = list(map(int, input().split()))\n    if a == b:\n        print(0)\n    elif (b - a) % 2 and a < b:\n        print(1)\n    elif (a - b) % 2 == 0 and a > b:\n        print(1)\n    else:\n        print(2)\n\n\nfor i in range(int(input())):\n    solve()\n", "passed": true, "time": 0.26, "memory": 14324.0, "status": "done"}, {"code": "def main():\n    a, b = list(map(int, input().split()))\n    if a == b:\n        print(0)\n    elif a > b:\n        if (b - a) % 2 == 0:\n            print(1)\n        else:\n            print(2)\n    else:\n        if (b - a) % 2 == 0:\n            print(2)\n        else:\n            print(1)\n\n\ndef __starting_point():\n    t = int(input())\n    for i in range(t):\n        main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "import math\n\n\nclass Read:\n    @staticmethod\n    def string():\n        return input()\n\n    @staticmethod\n    def int():\n        return int(input())\n\n    @staticmethod\n    def list(sep=' '):\n        return input().split(sep)\n\n    @staticmethod\n    def list_int(sep=' '):\n        return list(map(int, input().split(sep)))\n\n\ndef solve():\n    a, b = Read.list_int()\n    if a == b:\n        print(0)\n    elif a > b:\n        if (a - b) % 2 == 0:\n            print(1)\n        else:\n            print(2)\n    else:\n        if (b - a) % 2 == 1:\n            print(1)\n        else:\n            print(2)\n\n\n# query_count = 1\nquery_count = Read.int()\nwhile query_count:\n    query_count -= 1\n    solve()\n", "passed": true, "time": 0.15, "memory": 14232.0, "status": "done"}, {"code": "t = int(input())\nwhile t:\n    t += -1\n    a, b = map(int, input().split())\n    if b == a: print(0)\n    elif b > a:\n        if (b - a) % 2: print(1)\n        else: print(2)\n    else:\n        if (a - b) % 2: print(2)\n        else: print(1)", "passed": true, "time": 0.27, "memory": 14340.0, "status": "done"}, {"code": "t = int(input())\nfor _ in range(t):\n    a, b = list(map(int, input().split()))\n    if a==b:\n        print(0)\n    elif a%2==b%2:\n        if a>b:\n            print(1)\n        else:\n            print(2)\n    else:\n        if a>b:\n            print(2)\n        else:\n            print(1)\n", "passed": true, "time": 0.26, "memory": 14408.0, "status": "done"}, {"code": "t = int(input())\nfor iii in range(t):\n\ta, b = list(map(int, input().split()))\n\ttmp = b - a\n\tif tmp == 0:\n\t\tprint(0)\n\telif (a < b and tmp % 2 == 1) or (a > b and tmp % 2 == 0):\n\t\tprint(1)\n\telse:\n\t\tprint(2)\n", "passed": true, "time": 0.26, "memory": 14144.0, "status": "done"}, {"code": "T = int(input())\n\nfor t in range(T):\n    a, b = list(map(int, input().split()))\n    res = 0\n    if b > a:\n        if (b % 2) != (a % 2):\n            res = 1\n        else:\n            res = 2\n    elif b < a:\n        if (b % 2) == (a % 2):\n            res = 1\n        else:\n            res = 2\n    print(res)\n", "passed": true, "time": 0.28, "memory": 14116.0, "status": "done"}, {"code": "#JMD\n#Nagendra Jha-4096\n\n \nimport sys\nimport math\n\n#import fractions\n#import numpy\n \n###File Operations###\nfileoperation=0\nif(fileoperation):\n    orig_stdout = sys.stdout\n    orig_stdin = sys.stdin\n    inputfile = open('W:/Competitive Programming/input.txt', 'r')\n    outputfile = open('W:/Competitive Programming/output.txt', 'w')\n    sys.stdin = inputfile\n    sys.stdout = outputfile\n\n###Defines...###\nmod=1000000007\n \n###FUF's...###\ndef nospace(l):\n    ans=''.join(str(i) for i in l)\n    return ans\n \n \n \n##### Main ####\nt=int(input())\nfor tt in range(t):\n    #n=int(input())\n    a,b= map(int, sys.stdin.readline().split(' '))\n\n    if(a==b):\n        print(0)\n    elif(a>b):\n        if((a-b)%2==0):\n            print(1)\n        else:\n            print(2)\n    else:\n        if((a-b)%2):\n            print(1)\n        else:\n            print(2)\n    #a=list(map(int,sys.stdin.readline().split(' ')))\n    \n    \n#####File Operations#####\nif(fileoperation):\n    sys.stdout = orig_stdout\n    sys.stdin = orig_stdin\n    inputfile.close()\n    outputfile.close()", "passed": true, "time": 0.15, "memory": 14140.0, "status": "done"}, {"code": "t=int(input())\nfor _ in range(t):\n    a,b=[int(x) for x in input().split()]\n    if(a==b):\n        print(0)\n    elif(a>b):\n        if((a-b)%2==0):\n            print(1)\n        else:\n            print(2)\n    else:\n        if((b-a)%2==0):\n            print(2)\n        else:\n            print(1)\n", "passed": true, "time": 0.24, "memory": 14088.0, "status": "done"}, {"code": "t = int(input())\nfor i in range(t):\n    a, b = map(int, input().split())\n    if a == b:\n        print(0)\n    elif (a & 1) == (b & 1):\n        if a < b:\n            print(2)\n        else:\n            print(1)\n    elif a < b:\n        print(1)\n    else:\n        print(2)", "passed": true, "time": 0.21, "memory": 14196.0, "status": "done"}, {"code": "for _ in range(int(input())):\n    a,b = list(map(int,input().split()))\n    if b==a:\n        print(0)\n    elif b>a:\n        if (b-a)%2==0:\n            print(2)\n        else:\n            print(1)\n    else:\n        if (a-b)%2==0:\n            print(1)\n        else:\n            print(2)\n        \n", "passed": true, "time": 0.15, "memory": 14376.0, "status": "done"}, {"code": "t = int(input().strip())\nfor _ in range(t):\n    a,b = list(map(int,input().strip().split()))\n    #nums = [int(i) for i in input().strip().split()]\n    if a == b:\n        print(0)\n    elif a > b:\n        if (a - b)%2 == 0:\n            print(1)\n        else:\n            print(2)\n    else:\n        if (b - a)%2 != 0:\n            print(1)\n        else:\n            print(2)\n", "passed": true, "time": 0.15, "memory": 14348.0, "status": "done"}, {"code": "import sys\nimport math\nimport itertools\nimport functools\nimport collections\nimport operator\nimport fileinput\n\ndef ii(): return int(input())\ndef mi(): return map(int, input().split())\ndef li(): return list(map(int, input().split()))\ndef lcm(a, b): return abs(a * b) // math.gcd(a, b)\ndef revn(n): return str(n)[::-1]\ndef dd(): return collections.defaultdict(int)\ndef ddl(): return collections.defaultdict(list)\ndef sieve(n):\n    if n < 2: return list()\n    prime = [True for _ in range(n + 1)]\n    p = 3\n    while p * p <= n:\n        if prime[p]:\n            for i in range(p * 2, n + 1, p):\n                prime[i] = False\n        p += 2\n    r = [2]\n    for p in range(3, n + 1, 2):\n        if prime[p]:\n            r.append(p)\n    return r\ndef divs(n, start=2):\n    r = []\n    for i in range(start, int(math.sqrt(n) + 1)):\n        if (n % i == 0):\n            if (n / i == i):\n                r.append(i)\n            else:\n                r.extend([i, n // i])\n    return r\ndef divn(n, primes):\n    divs_number = 1\n    for i in primes:\n        if n == 1:\n            return divs_number\n        t = 1\n        while n % i == 0:\n            t += 1\n            n //= i\n        divs_number *= t\ndef prime(n):\n    if n == 2: return True\n    if n % 2 == 0 or n <= 1: return False\n    sqr = int(math.sqrt(n)) + 1\n    for d in range(3, sqr, 2):\n        if n % d == 0: return False\n    return True\ndef convn(number, base):\n    newnumber = 0\n    while number > 0:\n        newnumber += number % base\n        number //= base\n    return newnumber\ndef cdiv(n, k): return n // k + (n % k != 0)\n\n\nfor _ in range(ii()):\n    a, b = mi()\n    if a == b:\n        print(0)\n    elif a < b and (b - a) % 2 == 0 or a > b and (a - b) % 2:\n        print(2)\n    else:\n        print(1)", "passed": true, "time": 0.23, "memory": 14508.0, "status": "done"}, {"code": "t = int(input())\nfor _ in range(t):\n\ta, b = map(int, input().split())\n\tif a == b:\n\t\tprint(0)\n\telif a < b and (b-a)%2 == 1:\n\t\tprint(1)\n\telif a > b and (a-b)%2 == 0:\n\t\tprint(1)\n\telse:\n\t\tprint(2)", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "t = int(input())\nfor i in range(t):\n    a, b = list(map(int, input().split()))\n    if (a == b):\n        print(0)\n    elif (a % 2 == b % 2 and a > b):\n        print(1)\n    elif (a % 2 != b % 2 and b > a):\n        print(1)\n    else:\n        print(2)\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "t = int(input())\n\nfor _ in range(t):\n    a, b = map(int, input().split())\n    if a == b:\n        print(\"0\")\n    elif a > b:\n        if (a - b) % 2:\n            print(2)\n        else:\n            print(1)\n    else:\n        if (b - a) % 2:\n            print(1)\n        else:\n            print(2)", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "import sys\ninput = sys.stdin.readline\n\ndef main():\n    for _ in range(int(input())):\n        a, b = map(int,input().split()) \n        if a == b:\n            print(0)\n            continue\n        if a < b:\n            if a % 2 == b % 2:\n                print(2)\n            else:\n                print(1)\n            \n        else:\n            if a % 2 == b % 2:\n                print(1)\n            else:\n                print(2)\n\n\nmain()", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "for _ in range(int(input())):\n    \n    a,b = map(int,input().split())\n    \n    if(a==b):\n        print(0)\n    elif(a>b):\n        h = a-b\n        if(h%2 == 0):\n            print(1)\n        else:\n            print(2)\n    else:\n        h = b-a\n        if(h%2 == 1):\n            print(1)\n        else:\n            print(2)", "passed": true, "time": 0.23, "memory": 14344.0, "status": "done"}, {"code": "t = int(input())\n\nfor _ in range(t):\n    a, b = map(int, input().split(' '))\n\n    if a == b:\n        print(0); continue\n    \n    if b > a:\n        if a & 1 == b & 1:\n            print(2); continue\n        else:\n            print(1); continue\n    else:\n        if a & 1 == b & 1:\n            print(1); continue\n        else:\n            print(2); continue", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\nimport sys\nfrom collections import Counter\n\ndef input(): return sys.stdin.readline().strip()\ndef list2d(a, b, c): return [[c] * b for i in range(a)]\ndef list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]\ndef list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\ndef ceil(x, y=1): return int(-(-x // y))\ndef INT(): return int(input())\ndef MAP(): return list(map(int, input().split()))\ndef LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]\ndef Yes(): print('Yes')\ndef No(): print('No')\ndef YES(): print('YES')\ndef NO(): print('NO')\n# sys.setrecursionlimit(10 ** 9)\nINF = 10 ** 18\nMOD = 10 ** 9 + 7\n\nfor _ in range(INT()):\n    a, b = MAP()\n\n    if a == b:\n        print(0)\n    elif a < b:\n        if abs(a - b) % 2 == 0:\n            print(2)\n        else:\n            print(1)\n    else:\n        if abs(a - b) % 2 == 0:\n            print(1)\n        else:\n            print(2)\n", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "def getarr(): return(list(map(int, input().split())))\n\ndef solve():\n\ta, b = getarr()\n\tif (a==b):\n\t\tprint(0)\n\tif (a < b):\n\t\tdiff = abs(a - b)\n\t\tif (diff % 2 == 1): print(1)\n\t\telse: print(2)\n\n\tif (a > b):\n\t\tdiff = abs(a - b)\n\t\tif (diff % 2 == 0): print(1)\n\t\telse: print(2)\n\nfor t in range(int(input())): solve()", "passed": true, "time": 0.15, "memory": 14260.0, "status": "done"}, {"code": "t=int(input())\nfor _ in range(t):\n    a,b=list(map(int,input().split()))\n    if a==b:\n        print(0)\n    elif b-a>0 and (b-a)%2!=0:\n        print(1)\n    elif b-a>0 and (b-a)%2==0:\n        print(2)\n    elif a-b>0 and (b-a)%2==0:\n        print(1)\n    elif a-b>0 and (b-a)%2!=0:\n        print(2)", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "import sys\ninput = sys.stdin.readline\ndef getInt(): return int(input())\ndef getVars(): return list(map(int, input().split()))\ndef getList(): return list(map(int, input().split()))\ndef getStr(): return input().strip()\n## -------------------------------\n\nt = getInt()\nfor i in range(t):\n    a, b = getVars()\n    if a == b:\n        print(0)\n    elif a > b:\n        if a%2 == b%2:print(1)\n        else: print(2)\n    else:\n        if a%2 == b%2:print(2)\n        else:print(1)\n", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "t = int(input())\n\nfor i in range(t):\n    line = input()\n    [a, b] = [int(x) for x in line.split(' ')]\n    \n    if a == b:\n        print(0)\n    \n    if a > b:\n        if a % 2 == b % 2:\n            print(1)\n        else:\n            print(2)\n    \n    elif a < b:\n        if a % 2 == b % 2:\n            print(2)\n        else:\n            print(1)\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "from math import ceil as cc\ndef mi():\n    return map(int, input().split())\n'''\n5\n2 3\n10 10\n2 4\n7 4\n9 3\n'''\nn = int(input())\nfor i in range(n):\n    a,b = mi()\n    if a==b:\n        print(0)\n    elif (b-a)%2==0 and b>a:\n        print(2)\n    elif (b-a)%2 and b>a:\n        print(1)\n    elif (b-a)%2==0 and b<a:\n        print(1)\n    else:\n        print(2)", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}]