#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef vector<int> vec;
//配列の添字ズレに注意
//=に注意

int main(){
  int a; cin>>a;
  
  int AC=0,WA=0,TLE=0,RE=0;
  rep(i,a){
    string s; sin>>s;
    if(s=="AC")AC++;
    if(s=="WA")WA++;
    if(s=="TLE")TLE++;
    if(s=="RE")RE++;
  }
  
  //string s; cin>>s;
  cout<<"AC x "<<AC<<endl<<"WA x "<<WA<<endl<<"TLE x "<<TLE<<endl<<"RE x "<<RE<<endl;
}