#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
void read(int& val) {
  int x = 0;
  int bz = 1;
  char c;
  for (c = getchar(); (c < '0' || c > '9') && c != '-'; c = getchar())
    ;
  if (c == '-') {
    bz = -1;
    c = getchar();
  }
  for (; c >= '0' && c <= '9'; c = getchar()) x = x * 10 + c - 48;
  val = x * bz;
}
const int mod = 1e9 + 7;
const int maxn = 1e6 + 11;
int n;
map<string, int> mpp;
int main() {
  int n;
  read(n);
  mpp["AC"] = 0;
  mpp["WA"] = 0;
  mpp["TLE"] = 0;
  mpp["RE"] = 0;
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    mpp[s]++;
  }
  for (auto to : mpp) {
    cout << to.first << " x " << to.second << endl;
  }
  return 0;
}
