#include using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; #define rep(i,n) for(ll i=0;i T div_floor(T a, T b) { return a / b - ((a ^ b) < 0 && a % b); } template T div_ceil(T a, T b) { return a / b + ((a ^ b) > 0 && a % b); } template inline bool chmin(T &x, U y) { return (y < x) ? (x = y, true) : false; } template inline bool chmax(T &x, U y) { return (x < y) ? (x = y, true) : false; } template ostream &operator<<(ostream &os, const vector &a){ if (a.empty()) return os; os << a.front(); for (auto e : a | views::drop(1)){ os << ' ' << e; } return os; } void dump(auto ...vs){ ((cout << vs << ' '), ...) << endl; } #include using Bint= boost::multiprecision::cpp_int; using i128=__int128_t; void solve() { ll Y,I,W,A,B; cin>>Y>>I>>W>>A>>B; if (W==0){ string ans=""; rep(i,Y){ ans+='y'; } rep(i,I){ ans+='i'; } // cout<=0 and mr>=0){ Bint v=ml*mr*W+mr*W*d+(ml-mr)*d*(d+1)/2; v*=C; if (d>1){ if (ml>0){ v+=(d-1)*B; } else{ v+=(d-2)*B; } } if (d==W-1){ if (mr>0){ v+=B; } } if (v>mv){ mv=v; md=d; mvl=ml; } } ml++; mr--; if (ml>=0 and mr>=0){ Bint v=ml*mr*W+mr*W*d+(ml-mr)*d*(d+1)/2; v*=C; if (d>1){ if (ml>0){ v+=(d-1)*B; } else{ v+=(d-2)*B; } } if (d==W-1){ if (mr>0){ v+=B; } } // dump(ml,d,mr,v); if (v>mv){ mv=v; md=d; mvl=ml; } } } ll mvr=I-md-mvl; string ans=""; rep(i,leftY){ ans+='y'; } rep(i,mvl){ ans+='i'; } rep(i,md){ ans+='w'; ans+='i'; } rep(i,W-md){ ans+='w'; } rep(i,mvr){ ans+='i'; } rep(i,rightY){ ans+='y'; } cout<sync_with_stdio(0); ll T=1; cin>>T; while (T--){ solve(); } return 0; }