As a member of the Association of Coin Minters (ACM), you are fascinated by all kinds of coins and your hobby is collecting national currency from different countries. Your friend, also an avid coin collector, desires some of your precious coins and proposes a game to win them.
She prepares two envelopes, each containing two coins from different countries. You are asked to choose one envelope. You can see their contents before making your choice, and you may also decline the offer and take neither. This process is repeated for a total of rounds. As the game progresses, you may also change your mind about previous picks if you think a better choice is possible. At the end, your friend examines the envelopes in your final selection and, from them, she picks a few envelopes herself. If her selection is non-empty and includes an even number of coins from every country (possibly zero), she wins and you must hand over your entire coin collection to her, losing years of effort. If you win, you keep all the coins from the envelopes you picked.
Despite the risks, the prospect of expanding your collection is so appealing that you accept the challenge. You must ensure you win as many coins as possible.
The first line of each test case contains the number of rounds (1 \le r \le 300); a line with r = 0 indicates the end of input. The next lines each contain four non-negative integers 0 \le a,\ b,\ c,\ d < 10000, meaning your friend puts coins from countries labelled and in one envelope, and and in the other. A blank line separates test cases.
Print one line per test case containing the largest number of coins you are guaranteed to obtain.
Esempio 1