#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int AC = 0, WA = 0, TLE = 0, RE = 0;
  cin >> n;
  while (n--) {
    string str;
    cin >> str;
    if (str == "AC") AC++;
    if (str == "WA") WA++;
    if (str == "TLE")
      TLE++;
    else
      RE++;
  }
  cout << "AC"
       << " "
       << "x"
       << " " << AC << "\n";
  cout << "WA"
       << " "
       << "x"
       << " " << WA << "\n";
  cout << "TLE"
       << " "
       << "x"
       << " " << TLE << "\n";
  cout << "RE"
       << " "
       << "x"
       << " " << RE << "\n";
}
