#include using namespace std; using Int=long long; using Real=long double; templateinline bool chmin(T&A,S B){if(A>B){A=B;return true;}else{return false;}} templateinline bool chmax(T&A,S B){if(A>S; for(char c:S)X+=dx[T.find(c)],Y+=dy[T.find(c)]; cout<>TE; while(TE--)sol(); }