#include #include #include #include #include using namespace std; string solve(int ng, int nb) { if(nb == 0) return string(ng, 'S'); if(ng == 0) return string(nb, 's'); string s = ""; int m = min(ng, nb); int n = max(ng, nb); char opS = 's'; char opH = 'h'; for(int i = 0; i < m; i++) { s += string(i, opH); s += string(1, opS); opH ^= 0x20; opS ^= 0x20; } char opT = opS; if(ng > nb) opT = 'S'; if(ng < nb) opT = 's'; for(int i = m; i < n; i++) { s += string(m, opH); opH ^= 0x20; s += string(1, opT); } s += string(m, opH); opH ^= 0x20; if((ng + nb) % 2 == 0) opS ^= 0x20; for(int i = m - 1; i >= 0; i--) { s += string(1, opS); s += string(i, opH); opS ^= 0x20; opH ^= 0x20; } return s; } int main(void) { ifstream fin("kindergarten.in"); int nCase; fin >> nCase; while(nCase--) { int iCase, ng, nb; fin >> iCase >> ng >> nb; cout << iCase << " " << ng * nb + ng + nb << endl; string s = solve(ng, nb); while(s.length() > 50) { cout << s.substr(0, 50) << endl; s = s.substr(50); } cout << s << endl; cout << endl; } return 0; }