Queens on a Torus

No attempts yetTime limit1sMemory limit128 MB

Problem

Young math students need games too, so someone had to invent a few clever ones for them. One of those games is the queens game.

The board is an N×NN \times N torus: an N×NN \times N square grid whose left edge is glued to its right edge, and whose top edge is glued to its bottom edge.

A queen attacks every square that shares her row, her column, or one of her diagonals. Since opposite edges of the board are glued together, rows, columns and diagonals wrap around the board.

Decide whether NN queens can be placed on this board so that no two of them attack each other.

Input

The input has several lines. Each line holds one board size NN (1N15000000001 \le N \le 1\,500\,000\,000).

The last line holds 0. Do not process that line.

Output

For every line except the final 0, print one line: Kralovny lze umistit. if the queens fit, or Kralovny se nevejdou. if they do not.