#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  int n;
  cin >> n;
  int C1 = 0, C2 = 0, C3 = 0, C4 = 0;
  for (int t = 0; t < n; t++) {
    cin >> a;
    if (a == "AC")
      C1++;
    else if (a == "WA")
      C2++;
    else if (a == "TLE")
      C3++;
    else if (a == "RE")
      C4++;
  }
  cout << "AC x " << C1 << endl
       << "WA x " << C2 << endl
       << "TLE x" << C3 << endl
       << "RE x" << C4;
}
