#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int max(int a, int b) {
  if (a > b) {
    return a;
  }
  return b;
}
int min(int a, int b) {
  if (a < b) {
    return a;
  }
  return b;
}
int main(void) {
  long int n;
  cin >> n;
  string str[10020];
  for (int i = 0; i < (int)(n); i++) {
    cin >> str[i];
  }
  long int a, b, c, d;
  a = 0;
  b = 0;
  c = 0;
  d = 0;
  for (int i = 0; i < n; ++i) {
    if (str[i] == "AC") a++;
    if (str[i] == "WA") b++;
    if (str[i] == "TLE") c++;
    if (str[i] == "RE") d++;
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << b << endl;
  cout << "TLE x " << c << endl;
  cout << "RE x " << 0 << endl;
}
