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