Exam#2849

Exam

1 second
256 megabytes
Very easy

Dislike of philosophy brings people together, and the need to take an exam brings them even closer. But the main thing is a clear sense of reluctance to prepare for it.

— See, Ira, you approach the teacher and propose the following: we have tickets, lying face down. Let's turn over of them, then you shuffle them thoroughly and put them in one pile. After that, I mean you, with your eyes closed, should divide them into two piles so that both piles contain the same number of tickets with their faces up. At this point, you are allowed to: swap any two tickets in the first pile, turn over a ticket in the first pile, or permanently move a ticket from the first pile to the second. All these actions are performed with your eyes closed, and you have no information about the state of the tickets, except that you know the number and remember all your actions. — Okay, so what? — If you succeed, the teacher lets you answer any of the open tickets. — And if not? — We'll have to believe in a miracle. — Why don't you try it yourself? — Not that I have a good reputation. — So you want to spoil mine? — Oh, three times.

Input

You are given one even integer (0 \leq K \leq 18) — the number of tickets flipped face up (initially all tickets are in the first pile).

Output

If it is not possible to divide the tickets into two non-empty piles as required, output -1. Otherwise, on the first line, print the number of actions (0 \leq Q \leq 2^9+36). Then, in lines, describe the sequence of operations. Each line should contain a command of one of the following three types:

  • swap i j — swap tickets at positions and in the first pile (1 \leq i \neq j \leq 18).

  • rev i — turn over the ticket at position in the first pile.

  • out i — move the ticket at position from the first pile to the second. After this operation, all tickets in the first pile from position i+1 onward shift down by one position.

Both piles must be non-empty and must contain the same number of tickets with their faces up.

Examples

Example 1

Loading
Loading