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