#include <bits/stdc++.h>
int main() {
  long N;
  std::cin >> N;
  std::string S[100000];
  long count[4] = {};
  for (long i = 0; i < N; i++) {
    std::cin >> S[i];
    if (S[i] == "AC") {
      count[0]++;
    } else if (S[i] == "WA") {
      count[1]++;
    } else if (S[i] == "TLE") {
      count[2]++;
    } else {
      count[3]++;
    }
  }
  std::cout << "AC x " << count[0] << std::endl;
  std::cout << "WA x " << count[1] << std::endl;
  std::cout << "TLE x " << count[2] << std::endl;
  std::cout << "RW x " << count[3] << std::endl;
  return 0;
}
