#include <iostream>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ull unsigned long long 
#define int long long
#define pb push_back 
#define mp make_pair
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound
#define endl "\n"
#define Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))
#define MAX 1e18
#define PI 3.14159265
const int mod = 1e9 + 7;
#define ordered_set tree<pair<int, int>, null_type,less<pair<int, int>>, rb_tree_tag,tree_order_statistics_node_update>
 
 
 
int power(int x, int y) 
{ 
   int res = 1;      
  
   
    while (y > 0) 
    { 
       
        if (y & 1) 
            res = (long long)(res*x); 
  
 
        y = y>>1; 
 
        if (x<=100000000)
        x = (long long)(x*x);
 
        //cout<<x<<'\n'; 
    } 
    return res; 
} 
 
int gcd (int a, int b) {
    if (b == 0)
        return a;
    else
        return gcd (b, a % b);
}

int ceiling(int a,int b){
  if(a%b!=0){
    return (a/b)+1;

  }
  else
    return (a/b);
}
 

 void solve()
 {
  int n;
  cin>>n;
  map<string,int>m;
  for(int i=0;i<n;i++){
    string s;
    cin>>s;
    m[s]++;
  }

  
    cout<<"AC"<<" "<<"*"<<" "<<m["AC"]<<endl;
    cout<<"WA"<<" "<<"*"<<" "<<m["WA"]<<endl;
    cout<<"TLE"<<" "<<"*"<<" "<<m["TLE"]<<endl;
    cout<<"RE"<<" "<<"*"<<" "<<m["RE"]<<endl;
  

  return;
 }


 int32_t main()
 {
  int t;
  t=1;
  while(t--){
    solve();
  }
  return 0;
 }
