#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) x.begin(),x.end()

void solve()
{
 ll n,ac=0,wa=0,tle=0,re=0;
 cin>>n;
  for(int i=0;i<n;i++){
    string a;
    cin>>a;
    if(a=="AC"){ac++;}
    if(a=="WA"){wa++;}
    if(a=="TLE"){tle++;}
    if(a=="RE"){re++;}
  }
  cout<<"AC"<<" x "<<ac<<endl;
  cout<<"WA"<<" x "<<wa<<endl;
  cout<<"TLE"<<" x "<<tle<<endl;
  cout<<"RE"<<" x "<<re<<endl;
  return 0;
}

int main()
{
 ios_base::sync_with_stdio(0);
 cin.tie(0);cout.tie(0);

     solve();

    return 0;
}

