Roll-call in Woop Woop High

No attempts yetTime limit1sMemory limit128 MB

Problem

The principal of Woop Woop High wants a daily measure of how her pupils are learning, so every morning she runs a roll-call.

Each pupil is given one question and may attempt it up to five times. A pupil stops as soon as they answer correctly; a pupil who never answers correctly uses all five attempts. From the answers, each pupil falls into exactly one of four groups:

  • Present — answered correctly on the very first attempt.
  • Needs to study at home — answered correctly, but only after one or more wrong attempts.
  • Needs remedial work after school — never answered correctly (every attempt was wrong).
  • Absent — gave no answer at all.

Write a program that reads each class's assessments and prints an attendance report.

Input

The first line contains an integer $K$ ($1 \le K \le 100$), the number of classes.

Each class begins with a line containing an integer $N$ ($1 \le N \le 50$), the number of pupils in that class. Each of the next $N$ lines describes one pupil: a name (a single word with no spaces) followed by up to five assessments. Each assessment is yes or y for a correct answer, or no or n for a wrong answer. A pupil listed with no assessments gave no answer.

Output

For each class, print a report of exactly five lines:

  1. Roll-call: X — the class number $X$, starting from $1$.
  2. Present: Y1 out of N — $Y_1$, the number of pupils who answered correctly on their first attempt.
  3. Needs to study at home: Y2 out of N — $Y_2$, the number of pupils who answered correctly only after one or more wrong attempts.
  4. Needs remedial work after school: Y3 out of N — $Y_3$, the number of pupils who never answered correctly.
  5. Absent: Y4 out of N — $Y_4$, the number of pupils who gave no answer.

Print the reports for the classes in order; $N$ is the number of pupils in the class.