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