#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC") c1++;
    if (s == "WA") c2++;
    if (s == "TLE") c3++;
    if (s == "RE") c4++;
  }
  cout << "AC x " << c1 << "\n";
  cout << "WA x " << c2 << "\n";
  cout << "TLE x" << c3 << "\n";
  cout << "RE x " << c4 << "\n";
  return 0;
}
