#include <bits/stdc++.h>
using namespace std;

int main(){
  int N; cin >> N;
  map<string,int> m{"AC":0, "WA":0,"TLE":0,"RE":0};
  for(int i = 0; i < N; i++){
    string tmp; cin >> tmp;
    m[tmp]++;
  }
    cout << "AC x " << cout << m["AC"] <<endl;
    cout << "WA x " << cout << m["WA"] <<endl;
    cout << "TLE x " << cout << m["TLE"] <<endl;
    cout << "RE x " << cout << m["RE"] <<endl;
  return 0;
}