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

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