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

int main() {
  
  int N;
  cin >> N;  
  string str;
  for (int i = 0; i < N; i++) {
  cin >> str.at(i);
  }
  
  int AC = 0;
  int WA = 0;
  int TLE = 0;
  int RE = 0;
  
  for (int i = 0; i < N; i++) {
  if (str.at(i)=="AC"){
  AC += 1
  }
  if (str.at(i)=="WA"){
  WA += 1
  }
  if (str.at(i)=="TLE"){
  TLE += 1
  }
  if (str.at(i)=="RE"){
  RE += 1
  }
  }  
  
  cout << "AC x " + AC << endl;
  cout << "WA x " + WA << endl;
  cout << "TLE x " + TLE << endl;
  cout << "RE x " + WA << endl;
  
}
