#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string result;
  int countAC = 0, countWA = 0, countTLE = 0, countRE = 0;
  for (int i = 0; i < N; i++) {
    cin >> result;
    if (result == "AC") {
      countAC += 1;
      cout << countAC << endl;
    } else if (result == "WA") {
      countWA += 1;
    } else if (result == "TLE") {
      countTLE += 1;
    } else if (result == "RE") {
      countRE += 1;
    }
  }
  cout << "AC x " << countAC << endl;
  cout << "WA x " << countWA << endl;
  cout << "TLE x " << countTLE << endl;
  cout << "RE x " << countRE << endl;
  return 0;
}
