#include <bits/stdc++.h>
int main(void) {
  int n;
  std::cin >> n;
  int r[4];
  std::string a[n];
  for (int i = 0; i < n; i++) {
    std::cin >> a[i];
    if (a[i] == "AC") {
      r[0]++;
    } else if (a[i] == "WA") {
      r[1]++;
    } else if (a[i] == "TLE") {
      r[2]++;
    } else {
      r[3]++;
    }
  }
  std::cout << "AC x " << a[0] << std::endl;
  std::cout << "WA x " << a[1] << std::endl;
  std::cout << "TLE x " << a[2] << std::endl;
  std::cout << "RE x " << a[3] << std::endl;
  return 0;
}
