#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
int n;
cin >> n;
int a[n]={0};
for(int i = 0; i < n; i++){
string s;
cin >> s;
int m;
if(s=="AC")  m=1;
if(s=="WA")  m=2;
if(s=="TLE")  m=3;
if(s=="RE")  m=4;
a[m]++;
}
cout << "AC x " <<  a[1] <<endl;
cout << "WA x " <<  a[2] <<endl;
cout << "TLE x " <<  a[3] <<endl;
cout << "RE x " <<  a[4] <<endl;
return 0;
 }    