#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a = 0, b = 0, c = 0, d = 0;
  cin >> n;
  string str[n];
  for (int i = 0; i < n; i++) {
    cin >> str[i];
  }
  for (int i = 0; i < n; i++) {
    if (str[i] == "AC")
      a++;
    else if (str[i] == "WA")
      b++;
    else if (str[i] == "TLE")
      c++;
    else
      d++;
  }
  cout << "AC"
       << " "
       << "x"
       << " " << a << endl;
  cout << "WA"
       << " "
       << "x"
       << " " << b << endl;
  cout << "TLE"
       << " "
       << "x"
       << " " << c << endl;
  cout << "RE"
       << " "
       << "x"
       << " " << d;
}
