#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
void in(long long& I) { cin >> I; }
void in(vector<long long>& I) {
  for (auto& i : I) {
    cin >> i;
  }
}
void in(list<long long>& I) {
  for (auto& i : I) {
    cin >> i;
  }
}
void in(string& s) { cin >> s; }
void out(long long O) { cout << O; }
void out(vector<long long>& O) {
  for (auto& o : O) {
    cout << o;
  }
}
void rout(bool b, string True, string False) {
  if (b)
    cout << True.c_str();
  else
    cout << False.c_str();
}
int main() {
  long long N;
  cin >> N;
  long long a = 0;
  long long w = 0;
  long long t = 0;
  long long r = 0;
  for (int i = 0; i < N; i++) {
    string buf;
    cin >> buf;
    if (buf == "AC") a++;
    if (buf == "WA") w++;
    if (buf == "TLE") t++;
    if (buf == "RE") r++;
  }
  cout << "AC x " << a;
  cout << "WA x " << w;
  cout << "TLE x " << t;
  cout << "RE x " << r;
}
