#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
map<string, int> m;
void io() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
}
int main(int argc, char const *argv[]) {
  io();
  int n;
  cin >> n;
  string temp;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    m[temp]++;
  }
  cout << "AC x" << m["AC"] << endl;
  cout << "WA x" << m["WA"] << endl;
  cout << "TLE x" << m["TLE"] << endl;
  cout << "RE x" << m["RE"] << endl;
  return 0;
}
