
#include<iostream>
using namespace std;
int main()
{
 int n;
  cin>>n;
  string s1="AC",s2="WA",s3="TLE",s4="RE";
  string s[n];
  int i,c1=0,c2=0,c3=0,c4=0;
  for(i=0;i<n;i++)
  {
  
      cin>>s[i];
      if(s[i]==s1)
        c1++;
      else if(s[i]==s2)
        c2++;
      else if(s[i]==s3)
        c3++;
      else if(s[i]==s4)
        c4++;       
  
  }
  cout<<s1<<" "<<'+'<<c1<<endl<<s2<<" "<<'+'<<c2<<endl<<s3<<" "<<'+'<<c3<<endl<<s4<<" "<<'+'<<c4<<endl;