#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  string s[110000];
  for (int i = 0; i < N; i++) cin >> s[i];
  int j[4] = {};
  for (int i = 0; i < N; i++) {
    if (s[i] == "AC")
      j[0] += 1;
    else if (s[i] == "WA")
      j[1] += 1;
    else if (s[i] == "TLE")
      j[2] += 1;
    else if (s[i] == "RE")
      j[3] += 1;
  }
  cout << "AC"
       << " "
       << "x"
       << " " << j[0] << endl;
  cout << "AC"
       << " "
       << "x"
       << " " << j[1] << endl;
  cout << "AC"
       << " "
       << "x"
       << " " << j[2] << endl;
  cout << "AC"
       << " "
       << "x"
       << " " << j[3] << endl;
}
