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