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