#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    IOS;
    //ll t;cin>>t;while(t--)
    {
        ll a,b,c,d,i,j,k,l,m,n,sum=0,temp=0,f=0,cnt=0;
        string ac="AC",re="RE",tle="TLE",wa="WA";
        cin>>n;
        string s;
        a=0,b=0,c=0,d=0;
        for(i=0;i<n;i++)
        {
            cin>>s;
            if(s==ac)a++;
            if(s==re)b++;
            if(s==wa)c++;
            if(s==tle)d++;
        }
        cout<<ac<<" x "<<a<<endl;
        cout<<wa<<" x <<c<<endl;
        cout<<tle<<" x "<<d<<endl;
        cout<<re<<" x "<<b<<endl;
    }
}
