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