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