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