#include<iostream>
using namespace std;
int main(){
  int n,i;
  cin>>n;
  char arr1[]={"AC","WA","TLE","RE"};
  int arr2[]={0,0,0,0};
  char r;
  for(i=0;i<n;i++){
    cin>>r;
    if(r=="AC")arr2[0]++;
    else if(r=="WA")arr2[1]++;
    else if(r=="TLE")arr2[2]++;
    else if(r=="RE") arr2[3]++;
  }
  for(i=0;i<arr1.size();i++){
    cout<<arr1[i]<<" "<<"x"<<" "<<arr2[i];
  }
return 0;
}
