#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  string in;
  string key[4] = {"AC", "WA", "TLE", "RE"};
  int res[4];
  cin >> a;
  for (int i = 0; i < a; i++) {
    cin >> in;
    if (in == "AC")
      res[0]++;
    else if (in == "WA")
      res[1]++;
    else if (in == "TLE")
      res[2]++;
    else if (in == "RE")
      res[3]++;
  }
  for (int i = 0; i < 4; i++) {
    cout << key[i] << " x " << res[i] << endl;
  }
  return 0;
}
