#include <bits/stdc++.h>
using namespace std;
int N;
string S[100005];
int C[5];
int main(void) {
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> S[i];
    if (S[i] == "AC") {
      C[0]++;
    } else if (S[i] == "WA") {
      C[1]++;
    } else if (S[i] == "TLE") {
      C[2]++;
    } else {
      C[3]++;
    }
  }
  cout << "AC X " << C[0] << endl;
  cout << "WA X " << C[1] << endl;
  cout << "TLE X " << C[2] << endl;
  cout << "RE X " << C[3] << endl;
  return 0;
}
