#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  unsigned long long int n, AC = 0, WA = 0, TLE = 0, RE = 0;
  cin >> n;
  string aux;
  for (unsigned long long int i = 0; i <= n; ++i) {
    getline(cin, aux);
    if (aux == "AC") AC++;
    if (aux == "WA") WA++;
    if (aux == "TLE") TLE++;
    if (aux == "RE") RE++;
  }
  cout << "AC x " << AC << '\n';
  cout << "WA x " << WA << '\n';
  cout << "TLE x " << TLE << '\n';
  cout << "RE x " << RE << '\n';
  return 0;
}
