#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
#pragma GCC optimize(3)   
#define ll long long
#define pb push_back
#define F first
#define S second
#define all(c)  c.begin(), c.end()
#define rep(i,n) for(int i=0 ; i<n ; i++)
#define llv vector< ll >
#define mp make_pair
#define endl "\n"
#define N (ll)2e5+10
#define M (ll)1e18 
#define matrix vector<vector<ll> >
#define sz(x) (int)x.size()
 

int main(){
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif
    ios::sync_with_stdio(0);
    
    int n ;
    cin >> n ;
    map<string , int > m ;
    string s ;

    for(int i=0 ; i<n ; i++){
          cin >> s ;
          m[s]++ ;
    }
    cout << "AC X " << m["AC"] << endl ;
    cout << "WA X " << m["WA"] << endl ;
    cout << "TLE X " << m["TLE"] << endl ;
    cout << "RE X " << m["RE"] << endl ;  
     return 0 ;
    
    
 }