#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int c1 = 0;
  int c2 = 0;
  int c3 = 0;
  int c4 = 0;
  string s;
  cin >> N;
  for (int i = 0; i <= N; ++i) {
    cin >> s;
    if (s == "AC") ++c1;
    if (s == "WA") ++c2;
    if (s == "TLE") ++c3;
    if (s == "RE") ++c4;
  }
  cout << "AC"
       << "x" << c1 << endl;
  cout << "WA"
       << "x" << c2 << endl;
  cout << "TLE"
       << "x" << c3 << endl;
  cout << "RE"
       << "x" << c4 << endl;
  return 0;
}
