#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int cntac = 0, cntwa = 0, cnttl = 0, cntre = 0;
  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;
    if (s == "AC")
      cntac++;
    else if (s == "WA")
      cntwa++;
    else if (s == "TLE")
      cnttl++;
    else
      cntre++;
  }
  cout << "AC"
       << " x " << cntac << endl;
  cout << "WA"
       << " x " << cntwa << endl;
  cout << "TLW"
       << " x " << cnttl << endl;
  cout << "RE"
       << " x " << cntre << endl;
}
