#include <bits/stdc++.h>
using namespace std;
struct node {
  long long int val;
};
struct Interval {
  int start, end;
};
bool compare(struct node n1, struct node n2) { return (n1.val < n2.val); }
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  long long int n;
  cin >> n;
  long long int a, w, t, r = 0;
  string dummy;
  getline(cin, dummy);
  for (long long int i = 0; i < (n); ++i) {
    string str;
    getline(cin, str);
    if (str == "AC") ++a;
    if (str == "WA") ++w;
    if (str == "TLE") ++t;
    if (str == "RE") ++r;
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << w << endl;
  cout << "TLE x " << t << endl;
  cout << "RE x " << r << endl;
  return 0;
}
