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