#include<bits/stdc++.h>

using namespace std;

int main(){
	int n;
  cin >>n;
    	int c1=0;
      int c2=0;
      int c3=0;
      int c4=0;
  	while(n--){
    	string a;
      	cin >> a;
      	if(a=="AC"){c1++;}
      if(a=="WA"){c2++;}
      if(a=="TLE"){c3++;}
      if(a=="RE"){c4++;}
    }
  	cout <<"AC x "<<c1<<"\nWA x "<<c2<<"\nTLE x "<<c3<<"\nRE x "<<c4<<"";
TLE x 0
RE x 0"
	return 0;
}
