#include <bits/stdc++.h>
using namespace std;
string arr[100000];
int main() {
  int countAC = 0, countTLE = 0, countWA = 0, countRE = 0;
  int num;
  cin >> num;
  for (int i = 0; i < num; i++) {
    cin >> arr[i];
    if (arr[i] == "AC")
      countAC++;
    else if (arr[i] == "TLE")
      countTLE++;
    else if (arr[i] == "WA")
      countWA++;
    else if (arr[i] == "RE")
      countRE++;
  }
  cout << "\nAC X " << countAC;
  cout << "\n WA X " << countWA;
  cout << "\n TLE X " << countTLE;
  cout << "\n RE x " << countRE;
  return 0;
}
