#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int res[4] = {};
  string S;
  for (int i = 0; i < N; i++) {
    cin >> S;
    if (S == "AC") res[0]++;
    if (S == "WA") res[1]++;
    if (S == "TLE") res[2]++;
    if (S == "LE") res[3]++;
  }
  cout << "AC x " << res[0] << endl;
  cout << "WA x " << res[1] << endl;
  cout << "TLE x " << res[2] << endl;
  cout << "LE x " << res[3] << endl;
  return 0;
}
