#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string str[10000];
  for (int i = 0; i < N; i++) {
    cin >> str[i];
  }
  int* C = new int[4];
  for (int i = 0; i < 4; i++) {
    C[i] = 0;
  }
  for (int i = 0; i < N; i++) {
    if (str[i] == "AC") {
      C[0]++;
    } else if (str[i] == "WA") {
      C[1]++;
    } else if (str[i] == "TLE") {
      C[2]++;
    } else if (str[i] == "RE") {
      C[3]++;
    }
  }
  cout << "AC x " << C[0] << endl;
  cout << "WA x " << C[1] << endl;
  cout << "TLE x " << C[2] << endl;
  cout << "RE x " << C[3] << endl;
  delete[] C;
}
