#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; const ll MOD = 998244353; #include using namespace atcoder; using mint = modint998244353; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll n;cin>>n; vector A(n); rep(i,n) cin>>A[i]; vector> B(n); rep(i,n){ B[i] = bitset<12>(A[i]); } dsu uf(n); rep(i,12){ vector v; rep(j,n){ if(B[j][i]) v.push_back(j); } if(v.size()>1){ rep(j,(int)v.size()-1){ uf.merge(v[j],v[j+1]); } } } vector> G; map> mp; for(auto g:uf.groups()){ ll x=0; mp[uf.leader(g[0])]=g; for(auto i:g) x|=A[i]; G.push_back({x, uf.leader(g[0])}); } G.push_back({0, -1}); sort(all(G)); vector G1; for(auto p:G) G1.push_back(p.first); ll m = G.size(); rep(i,m-1){ G1[i+1]+=G1[i]; } ll sum=G1.back(); auto it=lower_bound(all(G1), G1.back()/2); vector Ans(n,'W'); ll q; if(*it*(sum-*it)>*(it-1)*(sum-*(it-1))){ q=it-G1.begin()+1; }else{ q=it-G1.begin(); } rep(i,q){ for(auto j:mp[G[i].second]){ Ans[j]='B'; } } cout<