
Walk Like an Egyptian is an old multiplayer board game once played by children of the Sahara nomad tribes. Children would collect stones and number each one. A game with $N$ players needs $N^2$ stones, and each player picks $N$ of them. The stones are laid out on an $N \times N$ grid in a peculiar order, as shown in Figure (a) (for $N = 4$). The player whose stone lands in the top-right corner loses the round. A new round is then played with $N - 1$ players, and $N - 1$ rounds in total decide the winner.
The layout follows an old rule that the Pharaohs' workers used to cross a dark room inside a pyramid without losing anyone (see Figure (b)):
The stones are numbered $1, 2, 3, \ldots, N^2$ in the exact order in which the workers take their places. Given $N$, determine the number written on the stone that ends up in the top-right corner of the grid.
The input contains one or more test cases. Each test case is given on its own line as a single integer $N$ ($0 < N < 1000$), the number of players.
The input ends with a line containing a single zero, which is not part of the test data.
For each test case, print one line in the form N => result, where $N$ is the number of players for that test case and result is the number on the stone at the top-right corner of the grid.