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