#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const long long MOD = 1000000007;
const long long inf = 1e18;
const double EPS = (1e-7);
inline int dcmp(double x, double y) {
  return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1;
}
void solve() {
  int n;
  cin >> n;
  string s;
  int cnt[4];
  map<string, int> typess;
  typess["AC"] = 0;
  typess["WA"] = 1;
  typess["TLE"] = 2;
  typess["RE"] = 4;
  memset(cnt, 0, sizeof(cnt));
  for (int i = 0; i < n; ++i) {
    cin >> s;
    cnt[typess[s]]++;
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d", cnt[0], cnt[1], cnt[2], cnt[3]);
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  solve();
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
  return 0;
}
