#include <bits/stdc++.h>

using namespace std;

int main(){
  int N;
  cin >> N;
  vector<int> s(N);
  for(int i =0; i < N; i++){
    cin >> s.at(i);
  }
  
  //表示されるのは'AC','WA','TLE','RE'
  int AC = 0;
  int wA = 0;
  int TLE = 0;
  int RE = 0;
  
  for ( int i = 0; i < N; i++){
    if(s.at(i) == "AC" )
      AC++;
    else if (s.at(i) == "WA")
      WA++;
    else if (S.at(i) == "TLE")
      TLE++;
    else
      RE++;
  }
  cout << "AC x " + AC << endl;
  cout << "WA x " + WA << endl;
  cout << "TLE x " + TLE << endl;
  cout << "RE x " + RE << endl;  
  
}