#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string a[N + 1];
  for (int i = 1; i <= N; i++) {
    cin >> a[i];
  }
  int h = 0, k = 0, g = 0, b = 0;
  for (int i = 1; i <= N; i++) {
    if (a[i] == "AC") h++;
    if (a[i] == "WA") k++;
    if (a[i] == "TLE") g++;
    if (a[i] == "RE") b++;
  }
  cout << "AC x" << h << endl;
  cout << "WA x" << k << endl;
  cout << "TLE x" << g << endl;
  cout << "RE x" << b << endl;
}
