#include <bits/stdc++.h>
using namespace std;
int main() {
  int x;
  string s = "";
  int AC = 0, WA = 0, TLE = 0, RE = 0;
  scanf("%d", &x);
  for (int j = 0; j < x; j++) {
    string s2 = "";
    cin >> s2;
    if (s2 == "AC") AC++;
    if (s2 == "WA") WA++;
    if (s2 == "TLE") TLE++;
    if (s2 == "RE") RE++;
    s2.clear();
  }
  printf("AC x %d\nWA x %d\nTLE x %d\n%RE x %d\n", AC, WA, TLE, RE);
  return 0;
}
