#include using namespace std; typedef long long ll; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b>Q; while(Q--){ ll A,B,C,K;cin>>A>>B>>C>>K; for(ll q=0;qB) swap(A,B); if(B>C) swap(B,C); if(A>B) swap(A,B); ll a=(A+B)/2,b=(B+C)/2,c=(C+A)/2; if(a>c) swap(a,c); if(b>c) swap(b,c); if(a>b) swap(a,b); if(vector{A,B,C}==vector{a,b,c}) break; A=a; B=b; C=c; } cout<