#include <bits/stdc++.h>
#include <iostream>

 using namespace std;
main () 
{
  
int n;
cin >> n;
int c1=0,c2=0,c3=0,c4=0;
for (int i = 0; i < n; i++)
{
    string s;
    cin >>s;
    if (s=="AC")
    c1++;
    else if (s=="WA")
    c2++;
    else if (s=="RE")
    c3++;
    else if (s=="TLE")
    c4++;
}
  cout << "AC x " << c1 << "\n"<<"WE x " << c2 << "\n"<< "TLE x " << c3 << "\n"<<"RE x " << c4 << "\n";

return 0;
    
}