CF474C Captain Marmot

Description

Captain Marmot wants to prepare a huge and important battle against his enemy, Captain Snake. For this battle he has $ n $ regiments, each consisting of $ 4 $ moles. Initially, each mole $ i $ ( $ 1

Input Format

Captain Marmot wants to prepare a huge and important battle against his enemy, Captain Snake. For this battle he has $ n $ regiments, each consisting of $ 4 $ moles. Initially, each mole $ i $ ( $ 1

Output Format

Print $ n $ lines to the standard output. If the regiment $ i $ can be made compact, the $ i $ -th line should contain one integer, the minimal number of required moves. Otherwise, on the $ i $ -th line print "-1" (without quotes).

Explanation/Hint

In the first regiment we can move once the second or the third mole. We can't make the second regiment compact. In the third regiment, from the last $ 3 $ moles we can move once one and twice another one. In the fourth regiment, we can move twice the first mole and once the third mole.