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