#include <bits/stdc++.h>
using namespace std;
const int MM = 1000000000;
const int MOD = MM + 7;
const int MAX = 510000;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long INF = 1LL << 60;
int main() {
  int n;
  cin >> n;
  int a, w, t, r;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") a++;
    if (s == "WA") w++;
    if (s == "TLE") t++;
    if (s == "RE") r++;
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << w << endl;
  cout << "TLE x " << t << endl;
  cout << "RE x " << r << endl;
}
