#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  scanf("%d", &n);
  map<string, int> mp;
  while (n--) {
    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;
}
