Hide

Problem F
Octopussy's Mittens

/problems/octopussy/file/statement/en/img-0001.jpg
8 kittens, count them!

You may recall the so-called octomom who had 8 babies that are now 15 years old. But how about Octopussy who had 8 kittens? Eventually 3 of them lost their mittens, and eventually found them again, but that is another story.

Octopussy’s owner thought that having nice warm mittens would be nice for the kittens because of the very cold weather where they live. Some already were suffering from frost bite, so she proceeded to knit the warm kitten mittens. In order to prevent the mittens from being damaged by sharp kitten claws, she reminded the kittens to keep their claws in their "clawsets" when wearing the mittens.

It so happened that the sizes of the mittens varied somewhat because it is always hard to control the tightness of the stitches. So, the owner measured the mittens using integers ranging from 1 through 10, grouping by 4’s. Kittens generally have all 4 paws of roughly the same size, also measured in integers from 1 through 10. Sizes are close enough so that being off by 1 either too large or too small is still sufficient for a kitten to wear them.

Your task is to examine all the kittens and all the mittens and determine if there are enough mittens to properly fit all the kittens. You will be provided all their sizes, but not necessarily in order.

Input

You will be given two lines of 8 integers, each being $1-10$, the first line representing the sizes of the 8 kittens’ paws, the second representing the sizes of each set of 4 mittens for the kittens.

Output

Print "All kittens can have mittens" if there is a complete matching of the mittens with kittens, or "Some kittens will not have mittens" if there is not a matching that has all kittens matched with distinct sets of mittens.

Sample Input 1 Sample Output 1
9 7 8 4 5 6 3 2
6 8 7 6 6 2 2 4
All kittens can have mittens
Sample Input 2 Sample Output 2
9 7 8 4 5 6 3 2
2 9 9 6 6 2 2 4
Some kittens will not have mittens

Please log in to submit a solution to this problem

Log in