#include <bits/stdc++.h>
using namespace std;
int n;
string s[10000];
void solve() {
  int bin[4];
  memset(bin, 0, sizeof(bin));
  for (int i = 0; i < n; i++) {
    if (s[i] == "AC") bin[0]++;
    if (s[i] == "WA") bin[1]++;
    if (s[i] == "TLE") bin[2]++;
    if (s[i] == "RE") bin[3]++;
  }
  cout << "AC x " << bin[0] << "\n";
  cout << "WA x " << bin[1] << "\n";
  cout << "TLE x " << bin[2] << "\n";
  cout << "RE x " << bin[3] << "\n";
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  solve();
}
