// Created by sahim on 7/3/2020.
#include"bits/stdc++.h"
using namespace std ;
#define ll unsigned long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

template <class ...Args>
auto &log(const Args &...args) {return ((cerr << " " << args), ...) << '\n';}
#define watch(...)  cerr << "[ "#__VA_ARGS__" ] = "; log(__VA_ARGS__) << '\n'
//C++17
template<typename... Args>
void read(Args&... args){((cin >> args), ...);}
template<typename... Args>
void write(Args... args){((cout << args << " "), ...);}

const int mod = 1e9 +7 ;



int main() {
    IOS
    int n ;
    cin >>  n ;
    map< string ,int > mp ;
    string s ;
    for (int i = 0; i <n ; ++i) {
        cin>> s;
        mp[s]++;
    }
    int l = mp.size();
    cout << "AC * " << mp["AC"]<< '\n' ;

    cout << "WA * " << mp["WA"]<< '\n' ;

    cout << "TLE * " << mp["TLE"]<< '\n' ;

    cout << "RE * " << mp["RE"]<< '\n' ;
  

}


