import 'dart:io';


main(){
  var d = Data.readN(null);
  d.readStrings();
  d.s.forEach((element) {
    if(element == 'AC'){
      d.ans[0]++;
    } else if(element == 'WA'){
      d.ans[1]++;
    } else if(element == 'TLE'){
      d.ans[2]++;
    } else {
      d.ans[3]++;
    }
  });
  print('''AC x $d.ans[0]
WA x $d.ans[1]
TLE x $d.ans[2]
RE x $d.ans[3]
''')
}

class Data {
  int n;
  List<num> _a;
  List<String> s;
  List<dynamic> ans;
  num get a => _a[0];
  int ansLength;
  Data.readN(this.ansLength){
    n = int.parse(stdin.readLineSync());
    if(ansLength == null)ansLength = n;
    ans = List<dynamic>.generate(ansLength, (index) => 0);
  }

  readNum() => _a.add(num.parse(stdin.readLineSync()));

  readNums(){
    for(int i = 0; i < n; i++){
      readNum();
    }
  }

  readString(){
    s.add(stdin.readLineSync());
  }

  readStrings(){
    for(int i = 0; i < n; i++){
      readString();
    }
  }
}