#include <bits/stdc++.h>
using namespace std;
using bigint = long long int;
using vi = vector<int>;
bigint arr[300011];
int main() {
  int N;
  cin >> N;
  map<string, int> m;
  m["AC"] = 0, m["WA"] = 0, m["TLE"] = 0, m["RE"] = 0;
  for (int i = 0; i < N; i++) {
    string str;
    cin >> str;
    m[str]++;
  }
  cout << "AC"
       << " X " << m["AC"] << "\n";
  cout << "WA"
       << " X " << m["WA"] << "\n";
  cout << "TLE"
       << " X " << m["TLE"] << "\n";
  cout << "RE"
       << " X " << m["RE"] << "\n";
  return 0;
}
