const array = [];
process.stdin.on('data', chunk => {
  array.push(chunk.toString());
});
process.stdin.on('end', _ => {
  const judges = ['AC', 'WA', 'TLE', 'RE'];
  for (const judge of judges) {
    let count = 0;
    for (const item of array) {
      if (item === judge) count++;
    }
    console.log(`${judge} x ${count}`);
  }
});