#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;
  int AC = 0, WA = 0, TLE = 0, RE = 0;
  map<char, int> mc;
  scanf("%d", &x);
  char ch, ch2;
  while (x--) {
    string s2 = "";
    cin >> s2;
    if (s2 == "AC") AC++;
    if (s2 == "WA") WA++;
    if (s2 == "TLE") TLE++;
    if (s2 == "RE") RE++;
  }
  printf("AC x %d\nWA x %d\nTLE x %d\n%RE x %d\n", AC, WA, TLE, RE);
  return 0;
}
