#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  vector<string> S;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> S[i];
    if (S[i] == "AC") c1++;
    if (S[i] == "WA") c2++;
    if (S[i] == "TLE") c3++;
    if (S[i] == "RE") c4++;
  }
  cout << "AC "
       << "x " << c1 << endl;
  cout << "WA "
       << "x " << c2 << endl;
  cout << "TLE "
       << "x " << c3 << endl;
  cout << "RE "
       << "x " << c4 << endl;
  return 0;
}
