#include <bits/stdc++.h>
using namespace std;
const int N = 40043;
const long long int mod = 1e9 + 7;
const long long int INF = (1LL << 60) - 1;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int lcm(int a, int b) { return (a * b) / gcd(a, b); }
long long int pow(long long int a, long long int b, long long int mo) {
  if (a == 0) return 1;
  long long int u = pow(a, b / 2, mo);
  u = (u % mod * u % mod) % mo;
  if (b % 2 == 1) u = (u % mod * a % mod) % mod;
  return u;
}
long long int power(long long int a, long long int b) {
  long long int ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
long long int xx, yy, dd;
void equation(long long int a, long long int b) {
  if (b == 0) {
    xx = 1;
    yy = 0;
    dd = a;
  } else {
    equation(b, a % b);
    long long int temp = xx;
    xx = yy;
    yy = temp - (a / b) * yy;
  }
}
long long int inverse(long long int a, long long int m) {
  equation(a, m);
  return (xx % m + m) % m;
}
bool compare(const pair<long long int, long long int> &i,
             pair<long long int, long long int> &j) {
  if (i.first == j.first)
    return i.second > j.second;
  else
    return i.first < j.first;
}
void solve() {
  long long int n;
  cin >> n;
  map<string, long long int> mp;
  string second;
  for (long long int i = 0; i < n; i++) {
    cin >> second;
    mp[second]++;
  }
  cout << "AC * " << mp["AC"] << endl;
  cout << "WA * " << mp["WA"] << endl;
  cout << "TLE * " << mp["TLE"] << endl;
  cout << "RE * " << mp["RE"] << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  while (t--) {
    solve();
    cout << endl;
  }
}
