Problem:
Score : 200 points

Problem Statement

Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.

The problem has N test cases.

For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively.

See the Output section for the output format.

Constraints

1 \leq N \leq 10^5

S_i is AC, WA, TLE, or RE.

Input

Input is given from Standard Input in the following format:

N
S_1
\vdots
S_N

Output

Let C_0, C_1, C_2, and C_3 be the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively. Print the following:

AC x C_0
WA x C_1
TLE x C_2
RE x C_3

Sample Input 1

6
AC
TLE
AC
AC
WA
TLE

Sample Output 1

AC x 3
WA x 1
TLE x 2
RE x 0

We have 3, 1, 2, and 0 test case(s) for which the verdict is AC, WA, TLE, and RE, respectively.

Sample Input 2

10
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC

Sample Output 2

AC x 10
WA x 0
TLE x 0
RE x 0

Solution in C++ (GCC 9.2.1) (judge verdict: Accepted)

#include <bits/stdc++.h>
#include <stdio.h>
using namespace std;  //これで"std::cout"が"cout"と書ける
#pragma GCC optimize("Ofast")

//MACRO
typedef long long lint;                //64bit以上を表現可能な型
#define INF 100000000                  //ほぼ無限
#define itn int                        //タイポ対策
#define all(x) (x).begin(), (x).end()  //sort(all(x))などとする
#define SZ(x) ((int)(x).size())        //size()簡略化
//repetition
#define FOR(i, p, b) for (int i = (p); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define repR(i, n) for (int i = n; i >= 0; i--)  //リバース
//debug
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \<< " " << __FILE__ << endl;
template <class T>
bool chmax(T &m, const T &b) {  //aよりbが大きければaに代入(参照渡し)
    if (m < b) {
        m = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &m, const T &b) {  //aよりbが小さければaに代入//参照渡し
    if (b < m) {
        m = b;
        return 1;
    }
    return 0;
}

int ctoi(const char c) {  //CtoI(int) charを渡すとintに変換する、数字以外だと-1を返す
    if ('0' <= c && c <= '9') return (c - '0');
    return -1;
}

class range {
   private:
    struct I {
        int x;
        int operator*() { return x; }
        bool operator!=(I &lhs) { return x < lhs.x; }
        void operator++() { ++x; }
    };
    I i, n;

   public:
    range(int n) : i({0}), n({n}) {}
    range(int i, int n) : i({i}), n({n}) {}
    I &begin() { return i; }
    I &end() { return n; }
};

template <typename T>
std::string to_string(const T &n) {
    std::ostringstream stm;
    stm << n;
    return stm.str();
}

template <typename List>
/*
好きな区切り文字でsplit
引数:対象の文字列,区切り文字,結果を格納する可変長配列
*/
void split(const std::string &s, const std::string &delim, List &result) {
    result.clear();

    using string = std::string;
    string::size_type pos = 0;

    while (pos != string::npos) {
        string::size_type p = s.find(delim, pos);

        if (p == string::npos) {
            result.push_back(s.substr(pos));
            break;
        } else {
            result.push_back(s.substr(pos, p - pos));
        }

        pos = p + delim.size();
    }
}

// vectorからindex番目の要素を削除する
template <typename T>
void remove(std::vector<T> &vector, unsigned int index) {
    vector.erase(vector.begin() + index);
}

/*エラトステネスのふるい
vector<bool> num(100000 + 2, true);
num[0] = false;
num[1] = false;

FOR(i, 2, SZ(num)) {
    if (num[i]) {
        for (int j = 2; (i * j) <= SZ(num); j++) {
            num[i * j] = false;
        }
    }
}
*/
using Graph = vector<vector<int>>;
typedef pair<int, int> P;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
//
//
//

//フィボナッチ数列
int fib(int num) {
    vector<int> dp(10000);  //計算結果を入れる
    dp[0] = 0;
    dp[1] = 1;
    for (int i = 2; i <= num; i++) {
        dp[i] = dp[i - 1] + dp[i - 2];
    }
    return dp[num];
}

// 桁和を計算する関数
int digit_sum(int n) {
    int ans = 0;
    while (n > 0) {
        ans += n % 10;
        n /= 10;
    }
    return ans;
}

main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    //
    int n, ac_cnt = 0, wa_cnt = 0, tle_cnt = 0, re_cnt = 0;
    string s;
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> s;
        if(s=="AC"){
            ac_cnt++;
        }
        if(s=="WA"){
            wa_cnt++;
        }
        if(s=="TLE"){
            tle_cnt++;
        }
        if(s=="RE"){
            re_cnt++;
        }
    }
    cout << "AC x " << ac_cnt << endl;
    cout << "WA x " << wa_cnt << endl;
    cout << "TLE x " << tle_cnt << endl;
    cout << "RE x " << re_cnt << endl;

    return 0;
}