#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N=32; int main() { int T; cin>>T; while(T--) { &nbs...