#include <bits/stdc++.h>
using namespace std;
long long expMod(long long A, long long B, long long C) {
  if (A == 0) return 0;
  if (B == 0) return 1;
  long long y;
  if (B % 2 == 0) {
    y = expMod(A, B / 2, C);
    y = (y * y);
    if (y >= C) {
      y = y % C;
    }
  } else {
    y = A % C;
    y = (y * expMod(A, B - 1, C) % C) % C;
  }
  return (long long)((y + C) % C);
}
int main() {
  long long n;
  scanf("%lld\n", &n);
  string s;
  map<string, int> freq;
  freq.insert({"AC", 0});
  freq.insert({"WA", 0});
  freq.insert({"TLE", 0});
  freq.insert({"RE", 0});
  for (long long i = 0; i < n; i++) {
    getline(cin, s);
    freq[s]++;
  }
  for (auto i : freq) cout << i.first << " x " << i.second << endl;
  return 0;
}
