#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> m;
  m["AC"] = 0;
  m["WA"] = 0;
  m["TLE"] = 0;
  m["RA"] = 0;
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;
    m[s]++;
  }
  cout << "AC x " << m["AC"] << endl;
  cout << "WA x " << m["WA"] << endl;
  cout << "TLE x " << m["TLE"] << endl;
  cout << "RA x " << m["RA"] << endl;
}
