#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  string S;
  cin >> N;
  vector<long long> judge(4, 0);
  for (long long i = 0; i < N; i++) {
    cin >> S;
    if (S == "AC")
      judge.at(0)++;
    else if (S == "WA")
      judge.at(1)++;
    else if (S == "TLE")
      judge.at(2)++;
    else if (S == "'RE")
      judge.at(3)++;
  }
  cout << "AC x " << judge.at(0) << endl;
  cout << "WA x " << judge.at(1) << endl;
  cout << "TLE x " << judge.at(2) << endl;
  cout << "RE x " << judge.at(3) << endl;
}
