

#include<bits/stdc++.h>
using namespace std;
int main()

{
    int n,int a=0,int t=0,int r=0,int a=0;
    cin>>n;
    while(n--)
    {
        string s;
        cin>>s;
        if(s=="AC")
            a++;
        if(s=="WA")
            w++;
        if(s=="TLE")
            t++;
        if(s=="RE")
            r++;

    }
    cout<<"AC x"<<a<<endl;
    cout<<"WA x"<<w<<endl;
    cout<<"TLE x"<<t<<endl;
    cout<<"RE x"<<r<<endl;
}
