#include using namespace std; using ll = long long; int main() { ll T,A,B,C,K,p,q,r; cin>>T; while(cin>>A>>B>>C>>K){ for(ll k=0;k