#include <bits/stdc++.h>
using namespace std;
int n;
string s;
map<string, int> letak;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    letak[s]++;
  }
  cout << "AC X " << letak["AC"] << endl;
  cout << "WA X " << letak["WA"] << endl;
  cout << "TLE X " << letak["TLE"] << endl;
  cout << "RE X " << letak["RE"] << endl;
}
