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