#include <bits/stdc++.h>
 
#define mp make_pair
#define eb emplace_back
#define ff first
#define ss second
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
 
const int MAXN = 100;
//#define int long long
const int INF = 1e9;
 
signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
 
	int n;
  cin >> n;
  map<string, int> m;
  for (int i = 0; i < n; i++){
  	string s;
    cin >> s;
    if (!m.count(s)) m[s] = 0;
    ms[s]++;
  }
  if (!m.count("AC")) m["AC"] = 0;
  if (!m.count("WA")) m["WA"] = 0;
  if (!m.count("TLE")) m["TLE"] = 0;
  if (!m.count("RE")) m["RE"] = 0;
  cout << "AC x " << m["AC"] << '\n';
  cout << "WA x " << m["WA"] << '\n';
  cout << "TLE x " << m["TLE"] << '\n';
  cout << "RE x " << m["RE"] << '\n';
 
    return 0;
}