#include using namespace std; using ll = long long; int main(){ int t; cin>>t; while(t--){ ll a,b,c,k; cin>>a>>b>>c>>k; if(k==0){ cout<