#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int ac = 0, tle = 0, wa = 0, re = 0;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC") ac++;
    if (s == "TLE") tle++;
    if (s == "WA") wa++;
    if (s == "RE") re++;
  }
  cout << "AC x " << ac << endl;
  cout << "RE x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}
