#include <bits/stdc++.h>
using namespace std;
int a[5005];
int main() {
  int i, j, k, l, t, z, n, r, x, y;
  cin >> n;
  map<string, int> m;
  string s;
  for (i = 0; i < n; i++) {
    cin >> s;
    m[s]++;
  }
  cout << "AC x " << m["AC"] << endl;
  cout << "WA x " << m["WA"] << endl;
  cout << "TLE x " << m["TLE"] << endl;
  cout << "RTE x " << m["RTE"] << endl;
}
