import 'dart:io';
main(List<String> args) {
  int N = int.parse(stdin.readLineSync());
  String aa = '';

  int ac = 0;
  int tle = 0;
  int wa = 0;
  int re = 0;
  
  for (int i = 0; i < N; i++) {
    aa = stdin.readLineSync();
    if (aa == 'AC') { ac += 1;} 
    else if (aa == 'TLE'){ tle += 1;} 
    else if (aa == 'WA'){ wa += 1;} 
    else { re += 1;}
  }
  print('AC x ${ac}');
  print('WA x ${wa}');
  print('TLE x ${tle}');
  print('RE x ${re}');
}