#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mm 1000000007
int main()
{
    IOS;
    ll a,b,c,d,e,AC=0,TLE=0,WA=0,RE=0;
    cin>>a;
    vector<string> A(a);
    for(b=0;b<a;b++)
    {
        cin>>A[b];
        if(A[b]=='AC') AC++;
        else if(A[b]=='WA') WA++;
        else if(A[b]=='TLE') TLE++;
        else RE++;
    }
    cout<<"AC x "<<AC<<endl;
    cout<<"WA x "<<WA<<endl;
    cout<<"TLE x "<<TLE<<endl;
    cout<<"RE x "<<RE<<endl;
}