#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d1, d2, d3, d4;
  string s;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    if (s == "AC") d1++;
    if (s == "WA") d2++;
    if (s == "TLE") d3++;
    if (s == "RE") d4++;
  }
  cout << "AC x " << d1 << endl;
  cout << "WA x " << d2 << endl;
  cout << "TLE x " << d3 << endl;
  cout << "RE x " << d4 << endl;
}
