#include <bits/stdc++.h>
using namespace std;
int main() {
  int te, i, a = 0, w = 0, t = 0, r = 0;
  string str;
  cin >> te;
  for (i = 1; i <= te; i++) {
    cin >> str;
    if (str == "AC") a++;
    if (str == "WA") w++;
    if (str == "TLE") t++;
    if (str == "RE") r++;
  }
  cout << "AC X " << a << endl;
  cout << "WA X " << w << endl;
  cout << "TLE X " << t << endl;
  cout << "RE X " << r << endl;
}
