#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
int main() {
  int N;
  cin >> N;
  map<string, int> M;
  for (ll i = 0; i < (ll)(N); i++) {
    string tmp;
    cin >> tmp;
    M[tmp]++;
  }
  cout << "AC X " << M["AC"] << endl;
  cout << "WA X " << M["WA"] << endl;
  cout << "TLE X " << M["TLE"] << endl;
  cout << "RE X " << M["RE"] << endl;
}
