#pragma GCC optimize(2)
#include <iostream>
#include <cstring>
#include <string>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include<algorithm>
using namespace std;
typedef long long ll;
const int mxn = 1e5+10;
int is[mxn],k,n,t,a[11],ans,res;
bool vis[mxn];
void prime(){
memset(vis,true,sizeof(vis)); res = 0 ;
for(int i=2;i<mxn;i++){
if(vis[i]){
is[++res]=i;
for(int j=2;i*j<mxn;j++) vis[i*j]=0;
}
}
}
int calc(int x)
{
int cnt=0,ans=0;
for(int i=1;i<=res && is[i]*is[i]<=x;i++){
if(x%is[i]==0){
cnt=0;
while(x%is[i]==0) ++cnt,x/=is[i];
if(is[i]==2) ++ans;
else ans+=cnt;
}
}
if(x>1) ans++;
return ans;
}
int main()
{
prime();
scanf("%d",&t);
while(t--){
scanf("%d",&n); ans=0;
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
ans^=calc(a[i]);
}
if(n==1&&a[1]==1){printf("L
");continue;}
if(ans) printf("W
");
else printf("L
");
}
return 0;
}