#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int num_AC, num_TLE, num_WA, num_RE;
  cin >> n;
  string str;
  while (n--) {
    cin >> str;
    if (str == "AC")
      num_AC++;
    else if (str == "TLE")
      num_TLE++;
    else if (str == "WA")
      num_WA++;
    else
      num_RE++;
  }
  cout << "AC x " << num_AC << endl;
  cout << "WA x " << num_WA << endl;
  cout << "TLE x " << num_TLE << endl;
  cout << "RE x " << num_RE << endl;
  return 0;
}
