The output for every scenario begins with a line containing “Scenario #i:”, where i is the number of the scenario starting at 1.
Then print on a single line the string of movements (denoted by characters N, E, S, W and, for no movement, X) that leads into a trap, of those the one that changes as few characters as possible, of those the one that leads into a trap as early as possible, of those the lexicographically first. This string must have c characters.
If no such string exists, output “impossible” on a single line. Terminate the output for the scenario with a blank line.