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

int main(){
  int n;
  vector< string > sample(4);
  sample[0] = "AC", sample[1] = "WA", sample[2] = "TLE", sample[3] = "RE";
  vector< int > a(4, 0);
  cin >> n;
  while( n-- ){
    string s;
    cin >> s;
    for(int i = 0 ; i < 4 )
      if( s == sample[i] )
      	a[i]++;
  }
  for(int i = 0 ; i < 4 ; i++)
    cout << sample[i] << " x " << a[i] << endl;
  return(0);
}