#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int count_1 = 0, count_2 = 0, count_3 = 0, count_4 = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") {
      count_1++;
    }
    if (s == "WA") {
      count_2++;
    }
    if (s == "RE") {
      count_3++;
    }
    if (s == "TLE") {
      count_4++;
    }
  }
  cout << "AC X " << count_1 << endl;
  cout << "WA X " << count_2 << endl;
  cout << "TLE X " << count_4 << endl;
  cout << "RE X " << count_3 << endl;
}
