#include<iostream>
#include<string>

using namespace std;

static const string STATUS_TYPE = {"AC", "WA", "TLE", "RE"};

int main(void) {
    const unsigned int MAX_STATUS_COUNT = 4;
    
    unsigned int input_count = 0;
  	cin >> input_count;
    
    string input;
    unsigned int results[MAX_STATUS_COUNT] = {};
    for (int i = 0; i < input_count; ++i) {
		cin >> input;
        for (int j = 0; j < MAX_STATUS_COUNT; ++j) {
            if (STATUS_TYPE[j] == input) {
                ++results[i];
            }
        }
    }
    
    for (int i = 0; i < MAX_STATUS_COUNT; ++i) {
   		cout << STATUS_TYPE[i] + " x " << results[i]  << endl;
    }

    return 0;
}