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