#include<bits/stdc++.h>
using namespace std;
int main(){
long int n,a=0,b=0,c=0,d=0;
string s;
cin>>n;
for(long int i=0;i<n;i++){
    cin>>s[i];
    if(s[i]=="AC")a++;
    else if(s[i]=="WA")b++;
    else if(s[i]=="TLE")c++;
    else if(s[i]=="RE")d++;
}

cout<< "AC"<<" x "<<a<<endl;
cout<< "WA"<<" x "<<b<<endl;
cout<< "TLE"<<" x "<<c<<endl;
cout<< "RE"<<" x "<<d<<endl;

return 0;
}