Eemel'yanov L.A.

The Magician lays out 36 cards in a $6 \times 6$ square (6 columns of 6 cards each) and asks the Spectator to mentally choose a card and remember the column containing it. After this, the Magician collects the cards in a certain way, lays them out again in a $6 \times 6$ square, and asks the Spectator to name the numbers of the columns containing the chosen card in the first and second layouts. After the Spectator's answer, the Magician infallibly guesses the card. How should the Magician act to ensure the trick always succeeds?
Let the Magician, after the first action, not shuffle the cards but collect them without disrupting the order in the columns, and stack them into the deck one column at a time. The second time, he lays out the cards row by row, meaning the former columns become rows. After the Spectator's response, the Magician knows the row and column numbers in the first layout that contain the chosen card, which allows him to name it.