#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <queue>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(x) (x).begin(), (x).end()

int main() {
    int n,a=0,b=0,c=0;
    cin>>n;
    vector<string>a(n);
    rep(i,n){
        cin>>a[i];
        if(a[i]=="AC")a++;
        else if(a[i]=="WA")b++;
        else if(a[i]=="TLE")c++;
    }
    cout<<"AC x "<<a<<endl;
    cout<<"WA x "<<b<<endl;
    cout<<"TLE x "<<c<<endl;
    cout<<"RE x "<<n-a-b-c<<endl;
    
    
	return 0;
}
