#include <bits/stdc++.h>
#include <algorithm>
#include <string>
#include <string.h>

using namespace std;

void init()
{
    cin.tie(0);
    cin.sync_with_stdio(0);
}

long long sumSums(int a[], int b, int e)
{

    long long sum = 0;
    for (int i = b; i <= e; i++)
    {
        sum += a[i];
    }
    return sum;

}

string removeZeros(string &s)
{
    int c = 0;
    for (int i = 0; i < s.length(); i++)
    {

        if (s[i] == '0')
            c++;
    }
    for (int i = 0; i < c; i++)
    {
        s.erase(s.find('0'), 1);
    }
    return s;

}

bool isPrime(int a)
{

    if (a == 1 || a == 0)
        return false;
    bool is = true;
    for (int i = sqrt(a); i >= 2; i--)
    {
        if ((a) % i == 0)
        {
            is = false;
            break;
        }
    }
    if (is)
        return true;
    else
        return false;

}

string intToString(int &a)
{
    string s = "";
    while (a != 0)
    {
        char c = a % 10 + '0';
        a = a / 10;
        s = c + s;
    }
    return s;

}

int stringToInt(string &s)
{
    int a = 0;
    int j = s.length() - 1;
    for (int i = 0; i < s.length(); i++)
    {
        int x = s[i] - '0';
        a += x * pow(10, j--);
    }
    return a;
}

int charToInt(char s)
{

    return s - '0';
}

bool isPalindrome(int a)
{

}

void print(int n)
{
    for (int i = 1; i < n; i++)
    {
        cout << i << " ";
    }
    cout << n;
}

int sum(int a, int b)
{

    return a + b;

}

int lenthOfInt(int a)
{

    int c = 1;
    while (a != 0)
    {

        c++;
        a = a / 10;

    }
    return c;
}

int lengthfunction(int number)
{
    int counter = 0;
    while (number)
    {
        number = number / 10;
        counter++;
    }
    return (counter);
}

bool found(string s, int a)
{

    for (int i = 0; i < a; i++)
    {
        if (s[a] == s[i])return true;
    }
    return false;
}

int nFound(string s[], int a)
{

    int c = 0;
    for (int i = 0; i < a; i++)
    {
        if (s[a] == s[i])c++;
    }
    return c;
}

bool isLuky(int n)
{
    string s = intToString(n);
    int is = true;
    for (int i = 0; i < s.length(); i++)
    {
        if (s[i] != '4' && s[i] != '7')
        {
            return false;

        }
    }

    return true;
}

bool isPalindrome(string str)
{
    int l = 0;
    int h = str.length() - 1;

    while (h > l)
    {
        if (str[l++] != str[h--])
        {

            return false;
        }
    }
    return true;
}
int fun(string str)
{
    int sum=0;
    for(int i=0; i<str.length(); i++)sum+=((int)(str[i]));

    return sum;

}
struct point
{
    string name;
    long long nameInt;
    int x,y,z,w,i;

};
void sortStruct(point p[],int len)
{
    bool swapped;
    do
    {
        swapped=false;
        for(int i=0; i<(len-1); i++)
        {
            if((fun(p[i].name)+p[i].y+p[i].w)<(fun(p[i+1].name)+p[i+1].y+p[i+1].w))
            {
                swap(p[i],p[i+1]);
                swapped=true;
            }

        }

    }
    while(swapped);

}
bool comparator(point p1,point p2)
{
    return (((fun(p1.name)+p1.y+p1.w)<(fun(p2.name)+p2.y+p2.w))||(((fun(p1.name)+p1.y+p1.w)==(fun(p2.name)+p2.y+p2.w)))&&p1.i>p2.i);


}
int main()
{
    init();

    int n;
    cin>>n;
    string s[n];
    int ACC=0,REC=0,TLEC=0,WAC=0;

    for(int i=0; i<n; i++)
    {
        cin>>s[i];
        if(s[i]=="AC")ACC+=1;
        else if(s[i]=="WA")WAC+=1;
        else if(s[i]=="RE")REC+=1;
        else if(s[i]=="TLE")TLEC+=1;

}


cout<<"AC" <<" " <<"x"<<" " <<ACC<<"\n";
cout<<"WA" <<" " <<"x"<<" " <<WAC<<"\n";
cout<<"TLE" <<" " <<"x"<<" " <<TLEC<<"\n";
cout<<"RE" <<" " <<"x"<<" " <<REC;

return 0;

}


Measured memory_bytes: 6740