#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << showpoint;
  cout << setprecision(11);
  int n;
  cin >> n;
  int ar[] = {0, 0, 0, 0};
  string v[] = {"AC", "WA", "TLE", "RE"};
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC")
      ar[0] += 1;
    else if (s == "WA")
      ar[1] += 1;
    else if (s == "TLE")
      ar[2] += 1;
    else if (s == "RE")
      ar[3] += 1;
  }
  for (int i = 0; i < 4; i++) {
    cout << v[i] << " X " << ar[i] << "\n";
  }
  return 0;
}
