#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  int c0, c1, c2, c3;
  for (ll i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") c0++;
    if (s == "WA") c1++;
    if (s == "TLE") c2++;
    if (s == "RE") c3++;
  }
  cout << "AC x " << c0 << endl;
  cout << "WA x " << c1 << endl;
  cout << "TLE x " << c2 << endl;
  cout << "RE x " << c3 << endl;
  return 0;
}
