#include <bits/stdc++.h>
#include <string.h>

using namespace std;

int main(){
  enum case = {AC, WA, TLE, RE};
  int n, array[4] = {0};
  string s, results[4] = {"AC", "WA", "TLE", "RE"};
  
  cin >> n;
  for(int i = 0; i < n; i++){
	cin >> s;
    for(int j = 0; j < 4; j++){
      if(s == results[j])
        array[j]++;
    }
  }
  
  for(int i = 0; i < 4; i++)
    cout << results[i] << " x " << array[i] << endl;
                  
  return 0;
}