#include <bits/stdc++.h>
using namespace std;
map<string, int> m;
int main() {
  long long t, n, i, j, k, l, mn = 0, mx = 1000;
  scanf("%lld", &t);
  string s;
  for (int i = 0; i < t; i++) {
    cin >> s;
    m[s]++;
  }
  cout << "AC x " << m["AC"] << "\n";
  cout << "WA x " << m["WA"] << "\n";
  cout << "TLE x " << m["TLE"] << "\n";
  cout << "RE  x " << m["RE "] << "\n";
}
