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