Knight jumps

Given a board with three columns and n rows, find a way for a chess
knight to visit exactly 3n − 2 cells, starting at any cell, and never
repeating any cell nor going outside the board.

Input

Input consists of several cases, each with an n between 3 and 10⁵.

Output

Print one line for each case, with any solution. Columns are labelled
with ‘a’, ‘b’ and ‘c’ in this order, while rows are numbered from 1 to
n. Follow strictly the format of the sample output.

Problem information

Author: Xavier Povill

Generation: 2026-01-25T12:18:39.239Z

© Jutge.org, 2006–2026.
https://jutge.org
