#include <bits/stdc++.h>
using namespace std;
constexpr long long INF = 1999999999999999997;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n;
  cin >> n;
  map<string, int> m;
  m["AC"] = 0;
  m["WA"] = 0;
  m["TLE"] = 0;
  m["RE"] = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    m[s]++;
  }
  for (auto j : m) {
    cout << j.first << ' ' << 'x' << ' ' << j.second << endl;
  }
}
