#include<bits/stdc++.h>

using namespace std;

int main()	
	{
  		int n;
  		cin >> n;
  		int ac = 0;
  		int tle = 0;
  		int wa = 0;
  		int re = 0;
  		for(int i = 0; i < n; i++)
        {
          string s;
          cin >> s;
          if(s=="Ac") ac++;
          if((s=="WA") wa++;
          if(s=="RE") re++;
           if(s=="TLE") tle++;
     
        }
        cout<<"AC " << "x" << ac<<endl;
         cout<<"WA " << "x" << wa<<endl;
             cout<<"TLE " << "x" << tle<<endl;
             cout<<"RE " << "x" << re<<endl;
             
      return 0;
     }
 