#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int tc;
  map<string, int> m;
  string s[200005];
  cin >> tc;
  for (int i = 0; i < tc; i++) {
    cin >> s[i];
    m[s[i]]++;
  }
  cout << "AC"
       << " X " << m["AC"] << endl;
  cout << "WA"
       << " X " << m["WA"] << endl;
  cout << "TLE"
       << " X " << m["TLE"] << endl;
  cout << "RE"
       << " X " << m["RE"] << endl;
  return 0;
}
