#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<string> S(N);
  int Ans[4] = {0};
  for (int i = 0; i < N; i++) cin >> S[i];
  for (int i = 0; i < N; i++) {
    if (S[i] == "AC")
      Ans[0]++;
    else if (S[i] == "WA")
      Ans[1]++;
    else if (S[i] == "TLE")
      Ans[2]++;
    else if (S[i] == "RA")
      Ans[3]++;
  }
  cout << "AC x " << Ans[0] << endl;
  cout << "WA x " << Ans[1] << endl;
  cout << "TLE x " << Ans[2] << endl;
  cout << "RA x " << Ans[3] << endl;
  return 0;
}
