#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int b, i, n, m, c = 0, p = 0, q = 0, r = 0, s = 0;
  string s1;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s1;
    if ((s1.compare("AC")) == 0) p++;
    if ((s1.compare("TLE")) == 0) q++;
    if ((s1.compare("RE") == 0)) r++;
    if ((s1.compare("WA")) == 0) s++;
  }
  cout << "AC x " << p << "\n";
  cout << "WA x " << q << "\n";
  cout << "TLE x " << r << "\n";
  cout << "RE x " << s << "\n";
}
