#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  int ac = 0, tle = 0, wa = 0, re = 0;
  vector<string> arr;
  for (int i = 0; i < n; i++) {
    cin >> s;
    arr.push_back(s);
  }
  for (int i = 0; i < n; i++) {
    if (arr[i] == "AC") ac += 1;
    if (arr[i] == "RE") re += 1;
    if (arr[i] == "WA") wa += 1;
    if (arr[i] == "TLE") tle += 1;
  }
  if (ac > 0)
    cout << "AC "
         << "x " << ac << endl;
  if (wa > 0)
    cout << "WA "
         << "x " << ac << endl;
  if (tle > 0)
    cout << "TLE "
         << "x " << ac << endl;
  if (re > 0)
    cout << "RE "
         << "x " << ac << endl;
  return 0;
}
