#include <bits/stdc++.h> 
using namespace std; 

int main(){
int A;
cin >> A;
  string S;
  int AC = 0;
  int WA = 0;
  int TLE = 0;
  int RE = 0;
  for(int i = 0;i < A;i++){
    cin >> S;
    if(S == 'AC'){
      AC++;
    }
    if(S == 'RE'){
      RE++;
    }
    if(S == 'WA'){
      WA++;
    }
      if(S == 'TLE'){
      TLE++;
    }
}
cout << "AC x " << AC << endl;
  cout << "WA x " << WA << endl;
  cout << "TLE x " << TLE << endl;
  cout << "RE x " << RE << endl;