#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a[4]={0};
  string s[4]={"AC","WA","TLE","RE"};
  int n;
  cin>>n;
  for(int i=0;i<n;i++)
  {
    string t;
    cin>>t;
    for(int j=0;j<4;j++)
    {
      if(t==s[j]) a[j]++;
    }
  }
  cout<<"AC X "<<a[0]<<"\n";
  cout<<"WA X "<<a[1]<<"\n";
  cout<<"TLE X "<<a[2]<<"\n";
  c