#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<string> S(N);
  int AC = 0, WA = 0, TLE = 0, RE = 0;
  for (int i = 0; i < N; i++) {
    cin >> S[i];
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == "AC") AC++;
    if (S[i] == "WA") WA++;
    if (S[i] == "TLE") TLE++;
    if (S[i] == "RE") RE++;
  }
  cout << "AC"
       << " " << AC << "\n";
  cout << "WA"
       << " " << WA << "\n";
  cout << "TLE"
       << " " << TLE << "\n";
  cout << "RE"
       << " " << RE << "\n";
}
