#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  string s;
  cin >> N;
  int AC = 0;
  int WA = 0;
  int TLE = 0;
  int RE = 0;
  for (int i = 0; i < N; i++) {
    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 << "TEL x " << TLE << endl;
  cout << "RE x " << RE << endl;
}
