#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios::sync_with_stdio(false);
  map<string, int> mp;
  int n;
  char ch[10];
  while (cin >> n) {
    for (int i = 0; i < n; ++i) cin >> ch, mp[ch]++;
    printf("AC x %d\n", mp["AC"]);
    printf("WA x %d\n", mp["WA"]);
    printf("TLE x %d\n", mp["TLE"]);
    printf("RE x %d\n", mp["RE"]);
  }
  return 0;
}
