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