#include <bits/stdc++.h>
using namespace std;
long long ceilVal(long long a, long long b) { return (a / b) + ((a % b) != 0); }
vector<long long> adj[1000000];
long long vis[1000000] = {0};
void dfs(long long w) {
  vis[w] = 1;
  for (long long u = 0; u < adj[w].size(); u++) {
    if (!vis[adj[w][u]]) dfs(adj[w][u]);
  }
}
long long power(long long x, long long y) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return power(x, y / 2) * power(x, y / 2);
  else
    return x * power(x, y / 2) * power(x, y / 2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long i, j, k, n, ans;
  string s;
  map<string, long long> m;
  cin >> n;
  i = 0;
  while (i < n) {
    cin >> s;
    m[s]++;
    i++;
  }
  cout << "AC"
       << " * " << m["AC"] << endl;
  cout << "WA"
       << " * " << m["WA"] << endl;
  cout << "TLE"
       << " * " << m["TLE"] << endl;
  cout << "RE"
       << " * " << m["RE"] << endl;
  return (0);
}
