Easy Chess
题号:NC54303
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
Special Judge, 64bit IO Format: %lld

题目描述

Elma is learning chess figures.
She learned that a rook can move either horizontally or vertically. To enhance her understanding of rook movement Elma’s grandmother gave Elma an 8 × 8 chess board and asked her to find a way to move the rook from a1 to h8 making exactly n moves, so that all visited cells are different.
A visited cell is the initial cell a1 and each cell on which the rook lands after a move.

输入描述:

The input contains a single integer n (2 ≤ n ≤ 63) — the desired number of moves.

输出描述:

Output a space-separated list of n+1 visited cells in the order they are visited by the rook. All cells must be different. The list should start with a1 and end with h8. A solution always exists.
示例1

输入

复制
4

输出

复制
a1 f1 c1 c8 h8

说明

备注:

Author: Mikhail Dvorkin