Petr and Basil play a game on an initially empty checkered table , making moves in turn. Petr starts. During his turn, the player writes any (capital) letter of the English alphabet into some empty cell (exactly one letter can be written in each cell). When all the cells are filled, Petr is declared the winner if there exist four consecutive cells horizontally in which the word «PETR» is written from left to right, or, if there exist four consecutive cells vertically in which the word «PETR» is written from top to bottom. Determine if Petr can win (regardless of Basil's actions).
Solution
He won't be able to.
Let's describe Vasya's winning strategy. Let Vasya always write the letter "Y" in a cell according to the following conditions; if the specified cell doesn't exist or is already occupied, or if Petya writes any letter other than "P" "E" "T" "R" then let Vasya write "Y" in any free cell.
If Petya writes the letter in some cell, then Vasya writes in the cell to its right; if Petya writes the letter then Vasya writes in the cell to its left; if Petya writes the letter then Vasya writes in the cell below it; if Petya writes the letter then Vasya writes in the cell above it.
From the first two conditions it follows that the sequence "PE" read from left to right cannot appear in two horizontally adjacent cells. Indeed, suppose a horizontal "PE" appears; then after the first of these two letters appears, Vasya, according to the described strategy, will immediately occupy the position of the second letter — a contradiction. Similarly, the sequence "TR" read from top to bottom cannot appear in two vertically adjacent cells.