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