#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S[N];
  for (int i = 1; i <= N; i++) {
    cin >> S[i];
  }
  int AC = 0;
  for (int j = 1; j <= N; j++) {
    if (S[j] == "AC") AC = AC + 1;
  }
  int WA = 0;
  for (int k = 1; k <= N; k++) {
    if (S[k] == "WA") WA = WA + 1;
  }
  int TLE = 0;
  for (int l = 1; l <= N; l++) {
    if (S[l] == "TLE") TLE = TLE + 1;
  }
  int RE = 0;
  for (int m = 1; m <= N; m++) {
    if (S[m] == "RE") RE = RE + 1;
  }
  cout << "AC x " << AC << endl;
  cout << "WA x " << WA << endl;
  cout << "TLE x " << TLE << endl;
  cout << "RE x " << RE << endl;
  return 0;
}
