#include <bits/stdc++.h>
using namespace std;
int main() {
  int c0 = 0, c1 = 0, c2 = 0, c3 = 0, n;
  cin >> n;
  string arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] == "AC")
      c0 = c0 + 1;
    else if (arr[i] == "WA")
      c1 = c1 + 1;
    else if (arr[i] == "TLE")
      c2 = c2 + 1;
    else if (arr[i] == "RE")
      c3 = c3 + 1;
  }
  cout << "AC x" << c0 << endl;
  cout << "WA x" << c1 << endl;
  cout << "TLE x" << c2 << endl;
  cout << "RE x" << c3 << endl;
  return 0;
}
