#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

int main(void) {

    int n;
    int q = 0, p = 0, e = 0,g = 0;
    string str;
    // 検索先の文字列
    string a = "A"; // 検索文字列 // AC
    string w = "W"; // WA
    string t = "T"; // TLE
    string r = "R"; // RE

    cin >> n;

    cin >> s;

    for (int i = 0; i < n; i++) {

        cin >> str;

        
        if (str.find('A') == 0) {
            
            q++;

        }

        if (s.find('W') == 0) {

            p++;

        }

        if (s.find('T') == 0) {

            e++;

        }

        
        if (s.find('R') == 0) {

            g++;

        }


    }


    cout << "AC × " << q << endl;
    cout << "WA × " << p << endl;
    cout << "TLE × " << e << endl;
    cout << "RE × " << g << endl;

    
    return 0;
}

