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

int main() {
  int N;
  cin >> N;
  vector<str> result;
  for (int i=0; i<N; i++){
      cin >> result.at(i);
  }
  int a=0,b=0,c=0,d=0;
  for (int i=0; i<N; i++){
      if (result.at(i)=="AC"){
          a++;
      }
      else if(result.at(i)=="WA"){
          b++;
      }
      else if(result.at(i)=="TLE"){
          c++;
      }
      else{
          d++;
      }
  }
  cout<<"AC x "<<a<<endl;<<"WA x "<<b<<endl;<<"TLE x "<<c<<endl;<<"RE x "<<d<<endl;
  }
