#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1LL << 60;
int main() {
  int n;
  cin >> n;
  int ac, wa, tle, re;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") ac++;
    if (s == "WA") wa++;
    if (s == "TLE") tle++;
    if (s == "RE") re++;
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}
