#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  int AC=0,WA=0,TLE=0,RE=0;
  cin<<N;
  string A;
  for(int i=0;i<N;i++){
    cin>>A;
    if(A=="AC"){AC++;}
    if(A=="WA"){WA++;}
    if(A=="TLE"){TLE++:}
    if(A=="RE"){RE++:}
  }
  cout <<"AC x "<<AC<<endl<<"WA x "<<WA<<endl<<"TLE x "<<TLE<<endl<<"RE x "<<RE<<endl;
  
}