#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
bool xor_logic(bool x, bool y) { return (x && y) || (!x && !y); }
void output(int AC, int WA, int TLE, int RE) {
  cout << "AC x " << AC << endl;
  cout << "WA x " << WA << endl;
  cout << "TLE x " << TLE << endl;
  cout << "RE x " << RE << endl;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  array<int, 4> counts_array;
  for (size_t i = 0; i < N; i++) {
    string input_line;
    cin >> input_line;
    if (input_line == "AC") {
      counts_array[0]++;
    }
    if (input_line == "WA") {
      counts_array[1]++;
    }
    if (input_line == "TLE") {
      counts_array[2]++;
    }
    if (input_line == "RE") {
      counts_array[3]++;
    }
  }
  output(counts_array[0], counts_array[1], counts_array[2], counts_array[3]);
  return 0;
}
