#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <ctime>
int main()
{
std::srand(std::time(NULL));
char Grid[5][5] = {'G', 'P', 'W', 'P'};
std::random_shuffle(&Grid[0][0], &Grid[0][0] + 5*5);
for(int r = 0; r < 5; ++r)
{
for(int c = 0; c < 5; ++c)
std::cout << (Grid[r][c] ? Grid[r][c] : '_') << ' ';
std::cout << '\n';
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8Y3N0ZGxpYj4KI2luY2x1ZGUgPGN0aW1lPgppbnQgbWFpbigpCnsKICAgIHN0ZDo6c3JhbmQoc3RkOjp0aW1lKE5VTEwpKTsKICAgIAogICAgY2hhciBHcmlkWzVdWzVdID0geydHJywgJ1AnLCAnVycsICdQJ307CiAgICBzdGQ6OnJhbmRvbV9zaHVmZmxlKCZHcmlkWzBdWzBdLCAmR3JpZFswXVswXSArIDUqNSk7CgogICAgZm9yKGludCByID0gMDsgciA8IDU7ICsrcikKICAgIHsKICAgICAgICBmb3IoaW50IGMgPSAwOyBjIDwgNTsgKytjKQogICAgICAgICAgICBzdGQ6OmNvdXQgPDwgKEdyaWRbcl1bY10gPyBHcmlkW3JdW2NdIDogJ18nKSA8PCAnICc7CiAgICAgICAgc3RkOjpjb3V0IDw8ICdcbic7CiAgICB9Cn0K