/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~**
* BISMILLAHIR RAHMANIR RAHIM *
**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define s(v) sort(v.begin(),v.end())
#define r(v) reverse(v.begin(),v.end())
#define pf printf
#define sf scanf
#define pb push_back
#define GCD(x,y) __gcd(x, y)
#define ll long long
#define lld long double
#define vs v.size()
#define ss s.size()
#define sd second
#define mp make_pair
#define ii pair<long long, long long>
#define iii pair<long long, ii>
#define cii pair<char, ii>
#define CheckMate return
using namespace std;
const long long MOD = 1000000007;
void oacm() {
int A,B,C;
cin>>A>>B>>C;
int arr[3] = {A, B, C};
sort(arr, arr + 3);
int diff1 = arr[1] - arr[0];
int diff2 = arr[2] - arr[1];
if (diff1 == 0 && diff2 == 0) {
cout<<0<<endl;
return;
}
if ((diff1 + diff2) % 2 == 0) {
cout<<1<<endl;
return;
}
cout<<2<<endl;
}
int main() {
fast;
int t;
cin >> t;
while (t--) {
oacm();
}
return 0;
}