#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, a, b, x, y, z, n, mx, mn, tmp;
  int cnt = 0, ans = 0;
  string s = "";
  vector<int> vc;
  unordered_map<string, int> mp;
  map<char, int> mc;
  scanf("%d", &x);
  char ch, ch2;
  while (x--) {
    string s2 = "";
    cin >> s2;
    mp[s2]++;
  }
  printf("AC x %d\nWA x %d\nTLE x %d\n%RE x %d\n", mp["AC"], mp["WA"],
         mp["TLE"], mp["RE"]);
  return 0;
}
