#include <bits/stdc++.h>
using namespace std;
void DBG() { cerr << "]\n"; }
template <class H, class... T>
void DBG(H h, T... t) {
  cerr << h;
  if (sizeof...(t)) {
    cerr << ", ";
  }
  DBG(t...);
}
int tt, n, k;
map<string, int> mp;
int main() {
  cin >> tt;
  while (tt--) {
    string s;
    cin >> s;
    mp[s]++;
  }
  printf("AC x %d\nWa x %d\nTLE x %d\nRE x %d", mp["AC"], mp["WA"], mp["TLE"],
         mp["RE"]);
  return 0;
}
