#include <bits/stdc++.h>
using namespace std;
int n;
string s[10000];
void solve() {
  map<string, int> map;
  map["AC"] = 0;
  map["WA"] = 0;
  map["TLE"] = 0;
  map["RE"] = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == "AC") map["AC"]++;
    if (s[i] == "WA") map["WA"]++;
    if (s[i] == "TLE") map["TLE"]++;
    if (s[i] == "RE") map["RE"]++;
  }
  cout << "AC x " << map["AC"] << "\n";
  cout << "WA x " << map["WA"] << "\n";
  cout << "TLE x " << map["TLE"] << "\n";
  cout << "RE x " << map["RE"] << "\n";
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  solve();
}
