#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  vector<string> v(n);
  for(int i=0;i<n;i++)
  {
    string s;
    cin>>s;
    v.push_back(s);
  }
  int ac=0,wa=0,tle=0,re=0;
  for(int i=0;i<v.size();i++)
  {
    if(v[i]=="AC") {ac++;}
    if(v[i]=="WA") {wa++;}
    if(v[i]=="TLE"}{tle++;}
    if(v[i]=="RE" }{re++;}
  }
  cout<<"AC "<<"x "<<ac<<endl;
  cout<<"WA "<<"x "<<wa<<endl;
  cout<<"TLE "<<"x "<<tle<<endl;
  cout<<"RE "<<"x "<<re<<endl;
}