#include <bits/stdc++.h>
using namespace std;
int main() {
  string arr[100000];
  int countAC = 0, countTLE = 0, countWA = 0, countRE = 0;
  int num;
  cin >> num;
  for (int i = 0; i < num; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < num; 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 << "\nWA"
       << " "
       << "x"
       << " " << countWA;
  cout << "\nTLE"
       << " "
       << "x"
       << " " << countTLE;
  cout << "\n RE "
       << " "
       << "x"
       << " " << countRE;
  return 0;
}
