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