#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
int main() {
  int n;
  cin >> n;
  map<string, int> ma;
  ma["AC"] = 0;
  ma["WA"] = 0;
  ma["TLE"] = 0;
  ma["RE"] = 0;
  for (int i = 0; i < (n); ++i) {
    string s;
    cin >> s;
    ma[s]++;
  }
  cout << "AC"
       << " "
       << "x"
       << " " << ma["AC"] << endl;
  cout << "wA"
       << " "
       << "x"
       << " " << ma["WA"] << endl;
  cout << "TLE"
       << " "
       << "x"
       << " " << ma["TLE"] << endl;
  cout << "RE"
       << " "
       << "x"
       << " " << ma["RE"] << endl;
  return 0;
}
