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