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