#include <bits/stdc++.h>
using namespace std;
const int MAX = 510000;
const int MOD = 1000000007;
int main() {
  long long N;
  cin >> N;
  map<string, long long> m;
  for (long long i = 0; i < N; i++) {
    string s;
    cin >> s;
    m[s]++;
  }
  cout << "AC"
       << " "
       << "X"
       << " " << m["AC"] << endl;
  cout << "WA"
       << " "
       << "X"
       << " " << m["WA"] << endl;
  cout << "TLE"
       << " "
       << "X"
       << " " << m["TLE"] << endl;
  cout << "RE"
       << " "
       << "X"
       << " " << m["RE"] << endl;
}
