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