#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>n>>x; vector a(n); for(Int i=0;i>a[i]; const Int MAX = 2e4; using P = pair; vector

vp,kp; for(Int i=0;i=MAX) vp.emplace_back(a[i],i); else kp.emplace_back(a[i],i); } vector dp(n*MAX,-1); dp[0]=n; for(Int i=0;i<(Int)kp.size();i++){ for(Int j=n*MAX-1;j>=0;j--){ if(dp[j]<0||j+kp[i].first>=n*MAX) continue; if(~dp[j+kp[i].first]) continue; dp[j+kp[i].first]=kp[i].second; } } Int s=1< sm(s,0),bs(s,0); for(Int i=0;i<(Int)vp.size();i++) bs[1<=n*MAX||dp[d]<0) continue; string ans(n,'x'); for(Int j=0;j<(Int)vp.size();j++) if((i>>j)&1) ans[vp[j].second]='o'; while(dp[d]