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