#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[4] = {0};
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC")
      a[0]++;
    else if (s == "WA")
      a[1]++;
    else if (s == "TLE")
      a[2]++;
    else
      a[3]++;
  }
  cout << "AC X " << a[0] << endl;
  cout << "WA X " << a[1] << endl;
  cout << "TLE X " << a[2] << endl;
  cout << "RE X " << a[3];
}
