#include using namespace std; #define int long long #define bui __builtin_popcount #define pii pair #define se second #define fi first #define mid (l+r>>1) const int inf=1e18; int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f; } const int mod=998244353; void prt(int x){ if(x<0)putchar('-'),x=-x; if(x<10)putchar(x+'0'); else prt(x/10),putchar(x%10+'0'); } int ksm(int x,int y){ if(y==0)return 1; int k=ksm(x,y/2); if(y&1)return k*k%mod*x%mod; return k*k%mod; } const int N=1e5+5; int fac[N],inv[N]; //int c(int n,int m){ // if(m>n||m<0)return 0; // return fac[n]*inv[m]%mod*inv[n-m]%mod; //} //int C(int n){ // return fac[2*n]*inv[n]%mod*inv[n+1]%mod; //} void init(){ fac[0]=1; for(int i=1;i=0;i--)inv[i]=inv[i+1]*(i+1)%mod; } int n,aw,zc[N],w[N],ans,sz[N]; char c[N]; vectorv[N]; void dfs(int x,int fa){ if(c[x]=='w')w[x]=1; sz[x]=1; int sumc=0; for(int i=0;i>n; cin>>c+1; for(int i=1;i<=n;i++)aw+=(c[i]=='w'); for(int i=1;i>x>>y; v[x].push_back(y); v[y].push_back(x); } dfs(1,0); cout<>t; while(t--)sl(); return 0; }