#include <bits/stdc++.h>
using namespace std;
const int inf = numeric_limits<int>::max() >> 2;
const long long linf = numeric_limits<long long>::max() >> 2;
const unsigned long long ulinf = numeric_limits<unsigned long long>::max() >> 2;
const double pi = acos(-1);
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dx8[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
const int dy8[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int main() {
  int n;
  cin >> n;
  map<string, int> m;
  for (int i = (0); i < (int)(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 << "RE x" << m["RE"] << endl;
  return 0;
}
