#include <bits/stdc++.h>
using namespace std;
int max(int a, float b) {
  if (a > b) return a;
  return b;
}
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  return a * b / gcd(max(a, b), min(a, b));
}
bool sort_pair(pair<int, int> a, pair<int, int> b) { return a.first > b.first; }
bool sort_pair_(pair<int, int> a, pair<int, int> b) {
  return a.second > b.second;
}
bool isprime(int x) {
  for (int i = 2; i <= sqrt(x); i++) {
    if (x % i == 0) return 0;
  }
  return 1;
}
bool prime[100002];
int main() {
  int t;
  scanf("%d", &t);
  string s1 = "AC", s2 = "WA", s3 = "TLE", s4 = "RE", s;
  int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  for (int i = 0; i < t; i++) {
    cin >> s;
    if (s == s1)
      c1++;
    else if (s == s2)
      c2++;
    else if (s == s3)
      c3++;
    else if (s == s4)
      c4++;
  }
  cout << s1 << 'x' << c1 << "\n";
  cout << s2 << 'x' << c2 << "\n";
  cout << s3 << 'x' << c3 << "\n";
  cout << s4 << 'x' << c4 << "\n";
}
