#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 2e5 + 15;
vector<int> adj[N];
int h[N];
long long int ans = 0;
priority_queue<int, vector<int>, greater<int> > q;
vector<pair<int, int> > L, R;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  map<string, int> mp;
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    mp[s]++;
  }
  cout << "AC * " << mp["AC"] << "\n";
  cout << "WA * " << mp["WA"] << "\n";
  cout << "TLE * " << mp["TLE"] << "\n";
  cout << "RE * " << mp["RE"] << "\n";
}
