#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<string> S(N);
  for (int i = 0; i < N; i++) {
    cin >> S[i];
  }
  int C0 = 0;
  int C1 = 0;
  int C2 = 0;
  int C3 = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == "AC") {
      C0 += 1;
    } else if (S[i] == "WA") {
      C1 += 1;
    } else if (S[i] == "TLE") {
      C2 += 1;
    } else if (S[i] == "RE") {
      C3 += 1;
    }
  }
  cout << "AC"
       << "x" << C0 << endl;
  cout << "WA"
       << "x" << C1 << endl;
  cout << "TLE"
       << "x" << C2 << endl;
  cout << "RE"
       << "x" << C3 << endl;
}
