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