#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  int count_AC = 0, count_WA = 0, count_TLE = 0, count_RE = 0;
  scanf("%d", &m);
  char arr[m + 5][4];
  for (int i = 0; i < m; i++) {
    scanf("%s", arr[i]);
    if (strcmp(arr[i], "AC") == 0)
      count_AC++;
    else if (strcmp(arr[i], "WA") == 0)
      count_WA++;
    else if (strcmp(arr[i], "TLE") == 0)
      count_TLE++;
    else if (strcmp(arr[i], "RE") == 0)
      count_RE++;
  }
  cout << "AC x" << count_AC << endl
       << "WA x" << count_WA << endl
       << "TLE x" << count_TLE << endl
       << "RE x" << count_RE << endl;
}
