#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

int T, n;
int pre, home, reme, abse;

int main()
{
    scanf("%d", &T);
    for (int cas = 1; cas <= T; ++cas)
    {
        pre = home = reme = abse = 0;
        scanf("%d", &n);
        for (int i = 1; i <= n; ++i)
        {
            char name[50], cnd[50];
            scanf("%s", name);
            int pos = 0;
            while (1)
            {
                while ((cnd[pos] = getchar()) == ' ');
                if (cnd[pos] == '\n') break;
                ++pos;
            }
            ++pos;
            cnd[pos] = 0;
            int nn = 0, yy = 0;
            for (int j = 0; j < pos; ++j)
            {
                if (cnd[j] == 'n') nn++;
                else if (cnd[j] == 'y') yy++;
            }
            if (cnd[0] == 'y') pre++;
            else
            {
                if (yy) home++;
                else
                {
                    if (nn) reme++;
                    else abse++;
                }
            }
        }
        printf("Roll-call: %d\n", cas);
        printf("Present: %d out of %d\n", pre, n);
        printf("Needs to study at home: %d out of %d\n", home, n);
        printf("Needs remedial work after school: %d out of %d\n", reme, n);
        printf("Absent: %d out of %d\n", abse, n);
    }
    return 0;
}
