#include <bits/stdc++.h>
using namespace std;
int n;
string s;
map<string, int> a;
int main() {
  cin >> n;
  while (n--) {
    cin >> s;
    a[s]++;
  }
  cout << "AC x " << a["AC"] << endl;
  cout << "WA x" << a["WA"] << endl;
  cout << "TLE x" << a["TLE"] << endl;
  cout << "RE x" << a["RE"] << endl;
  return 0;
}
