#include <bits/stdc++.h>
using namespace std;
int N;
int main() {
  cin >> N;
  int a = 0, b = 0, c = 0, d = 0;
  vector<string> S(100000);
  for (int i = 0; i < N; i++) cin >> S.at(i);
  for (int i = 0; i < N; i++) {
    if (S.at(i) == "AC")
      a++;
    else if (S.at(i) == "WA")
      b++;
    else if (S.at(i) == "TLE")
      c++;
    else
      d++;
  }
  cout << "AC x " << a << endl;
  cout << "wA x " << b << endl;
  cout << "TLE x " << c << endl;
  cout << "RE x " << d << endl;
}
