
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define f(i, n)         for(int i=0; i<n; i++)
#define fo(i, k, n)     for(int i=k; i<n; i++)
#define forr(i, a, b)   for(int i=a; i<=b; i++)
#define rf(i,n)         for(int i=n;i>=0;i--)
typedef unsigned long long ull;
typedef pair<int ,int> pr;
#define MAX 100005
#define INF 1000000009
#define   sq(n)         (n*n)
#define p(n) cout<<n<<endl
#define pb push_back
#define py cout<<"YES"<<endl;
#define pn cout<<"NO"<<endl;
#define __FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
ll lcm ( ll a, ll b )
{
    return ( a / __gcd ( a, b ) ) * b;
}
int main()
{
    __FastIO;

     int n;
     cin>>n;
     string s;
     int ac=0,tle=0,re=0,wa=0;
     for(int i=0;i<n;i++)
     {

         cin>>s;
         if(s=="AC")
         {
             ac++;
         }
         else if(s=="TLE")
         {
             tle++;
         }
         else if(s=="RE")
         {
             re++;
         }
         else if(s=="WA")
         {
             wa++;
         }
     }
     cout<<"AC "<<"X "<<ac<<endl;
     cout<<"WA "<<"X "<<wa<<endl;
     cout<<"TLE "<<"X "<<tle<<endl;
     cout<<"RE "<<"X "<<re<<endl;

    return 0;
}

