Mahershalalhashbaz, Nebuchadnezzar, and Billy Bob Benjamin Go to the Regionals

Time limit1sMemory limit128 MB

Problem

The Association for Computing Machinery (ACM) is considering new rules for its regional programming contests, in part to fix some software problems. For instance, the program that prints the badges for each team was designed so that the same font size is used for all of a team's badges. This means that if one team member has a very long name, a very small font is used for the whole team, which does not look nice next to someone with an extremely short name like AL.

The ACM's first idea was to cap the length of contestants' names, but someone pointed out that this would discriminate against regions where longer names are common (for example, children in the home town of a famous actor are often named after that actor — imagine how many children in Oakland, California have been named after the actor Mahershalalhashbaz Ali since he became a star of the television series The 4400).

As a compromise, the ACM changed the rule to require that no team member's name may have a length more than two away from the average of the lengths of all the team's members' names. Under this rule a team of MAHERSHALALHASHBAZ, AL, and BILL would be disqualified: the average name length is 8, and AL and BILL are not within 2 of 8. However, MAHERSHALALHASHBAZ, NEBUCHADNEZZAR, and BILLYBOBBENJAMIN would be fine: the average length is 16, and every name's length is within 2 of that.

Given the names of $n$ students, determine whether they can be split into teams of exactly $k$ members each so that every team satisfies the new rule.

Input

The input consists of multiple test cases. Each test case begins with a line containing two positive integers $n$ and $k$, where $n \le 1000$, $k \le 8$, and $n$ is divisible by $k$. The next $n$ lines each contain a single name made up only of uppercase letters, with no embedded, leading, or trailing spaces; these are the $n$ students to be organized into teams of $k$ each. No name is longer than 80 characters. The last test case is followed by a line containing two zeros.

Output

For each test case, print a line of the form Case X: yes or Case X: no, where $X$ is the test case number starting from 1. Print yes if the students can be split into teams of exactly $k$ members so that on every team no member's name length differs from that team's average name length by more than 2, and no otherwise. Print a blank line between consecutive test cases.