#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using pll = pair<ll, ll>;
template <class T1, class T2>
inline void chmax(T1 &a, const T2 &b) {
  if (a < b) {
    a = b;
  }
}
template <class T1, class T2>
inline void chmin(T1 &a, const T2 &b) {
  if (a > b) {
    a = b;
  }
}
constexpr ll INF = 0x3f3f3f3f3f3f3f3fLL;
int main() {
  ll N;
  cin >> N;
  ll AC = 0;
  ll WA = 0;
  ll TLE = 0;
  ll RE = 0;
  string input;
  for (ll i = 0, xxx_rep_end = (N); i < xxx_rep_end; ++i) {
    cin >> input;
    if (input == "AC") {
      ++AC;
    } else if (input == "WA") {
      ++WA;
    } else if (input == "TLE") {
      ++TLE;
    } else if (input == "WA") {
      ++RE;
    }
  }
  cout << "AC x " << AC << endl;
  cout << "WA x " << WA << endl;
  cout << "TLE x " << TLE << endl;
  cout << "RE x " << RE << endl;
}
