#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  int ac = 0, wa = 0, tle = 0, re = 0;
  for (int tt = 0; tt < t; tt++) {
    string s;
    cin >> s;
    if (s[0] == 'A')
      ac++;
    else if (s[0] == 'W')
      wa++;
    else if (s[0] = 'T')
      tle++;
    else
      re++;
  }
  cout << "AC x " << ac << "\n";
  cout << "WA x " << wa << "\n";
  cout << "TLE x " << tle << "\n";
  cout << "RE x " << re << "\n";
  return 0;
}
