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