

#include <iostream>
using namespace std;

int main()

{
a
    int arraysize, AC_count = 0, WA_count = 0, TLE_count = 0, RE_count = 0;

    string array[100];

    cin >> arraysize;

    for (int i = 0; i < arraysize; i++)

    {

        cin >> array[i];

        if (array[i] == "AC")

            AC_count++;

        else if (array[i] == "WA")

            WA_count++;

        else if (array[i] == "TLE")

            TLE_count++;

        else if (array[i] == "RE")

            RE_count++;

    }

    cout << "AC X " << AC_count << endl << "WA X " << WA_count << endl << "TLE X " << TLE_count << endl << "RE X " << RE_count << endl;

}