#include <bits/stdc++.h>
using namespace std;
int main() {
  string S[254];
  char s[254];
  int N;
  int a = 0, b = 0, c = 0, d = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> s;
    S[i] = s;
    if (S[i] == "AC")
      a++;
    else if (S[i] == "WA")
      b++;
    else if (S[i] == "TLE")
      c++;
    else if (S[i] == "RE")
      d++;
  }
  cout << "AC x " << a << '\n';
  cout << "WA x " << b << '\n';
  cout << "TLE x " << c << '\n';
  cout << "RE x " << d << '\n';
  return 0;
}
