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

int main(){
  int[] a={0,0,0,0};
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    string s;
    cin >> s;
    switch(s){
      case "AC":
        a[0]++;
        break;
      case "WA":
        a[1]++;
        break;
      case "TLE":
        a[2]++;
        break;
      case "RE":
        a[3]++;
        break;
    }
  }
  cout << "AC x " << a[0] << endl;
  cout << "WA x " << a[1] << endl;
  cout << "TLE x " << a[2] << endl;
  cout << "RE x " << a[3] << endl;
}