#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int c0, c1, c2, c3 = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    string S;
    cin >> S;
    if (S == "AC") {
      c0++;
    } else if (S == "WA") {
      c1++;
    } else if (S == "TLE") {
      c2++;
    } else if (S == "RE") {
      c3++;
    }
  }
  cout << "AC x " << c0 << endl;
  cout << "WA x " << c1 << endl;
  cout << "TLE x " << c2 << endl;
  cout << "RE x " << c3 << endl;
}
