#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using ld = long double;
const ll mod = (ll)1e9 + 7;
const ll mxN = (ll)1e6 + 3;
void solve() {
  ll n;
  cin >> n;
  map<string, ll> m;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    m[s]++;
  }
  cout << "AC X " << m["AC"] << "\n";
  cout << "WA X " << m["WA"] << "\n";
  cout << "TLE X " << m["TLE"] << "\n";
  cout << "RE X " << m["RE"] << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(20);
  cout << fixed;
  solve();
}
