#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int ac, wa, tle, re;
  for (int i; i < N; i++) {
    string S;
    cin >> S;
    if (S == "AC") {
      ac++;
    } else if (S == "WA") {
      wa++;
    } else if (S == "TLE") {
      tle++;
    } else {
      re++;
    }
  }
  cout << "AC"
       << " "
       << "x"
       << " " << ac << endl;
  cout << "WA"
       << " "
       << "x"
       << " " << wa << endl;
  cout << "TLE"
       << " "
       << "x"
       << " " << tle << endl;
  cout << "RE"
       << " "
       << "x"
       << " " << re << endl;
}
