#include<bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin>>n;
  string s={"AC","WA","TLE","RA"};
  int a[4]={};
  while(n--) {
    cin>>s;
    if(s=='AC') a[0]++;
    else if(s=='WA') a[1]++;
    else if(s=='TLE') a[2]++;
    else a[3]++;
  }
  for(int i=0;i<4;i++) {
    cout<<s[i]<<" x "<<a[i]<<endl;
  }
  return 0;
}