#include <bits/stdc++.h>
using namespace std;
#define int long long
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
typedef pair<int,int> pii;
const int mod = (int) 1000000007;
const int inf = (int) 2e18;
 
int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    int n;
    cin >> n;
    map<string, int> hash;
    hash['AC'] = 0;
    hash['WA'] = 0;
    hash['TLE'] = 0;
    hash['RE'] = 0;
    while(n--){
        string s;
        cin >> s;
        hash[s]++;
    }
    cout << "AC x " << hash['AC'] << "\n";
    cout << "WA x " << hash['WA'] << "\n";
    cout << "TLE x " << hash['TLE'] << "\n";
    cout << "RE x " << hash['RE'] << "\n";
}