#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin>>n;
    string s[n];
    int a[4]={0};
    for(i=0;i<n;i++)
    {
        if(s[i]=="AC")
        a[0]++;
        else if(s[i]=="WA")
        a[1]++;
        else if(s[i]=="TLE")
        a[2]++;
        else
        a[3]++;
    }
    cout<<"AC x "<<a[0]<<endl;
    cout<<"WA x "<<a[1]<<endl;
    cout<<"TLE x "<<a[2]<<endl;
    cout<<"RE x "<<a[3]<<endl;
}