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