#include <bits/stdc++.h>
using namespace std;
int search(vector<long long> v, long long m, int n) {
  int start = 0;
  int ans = -1;
  while (start <= n) {
    int mid = (start + n) / 2;
    if (v[mid] <= m)
      start = mid + 1;
    else {
      ans = mid;
      n = mid - 1;
    }
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string s[n];
  int a = 0, w = 0, t = 0, r = 0;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == "WA") w++;
    if (s[i] == "AC") a++;
    if (s[i] == "TLE") t++;
    if (s[i] == "RE") r++;
  }
  cout << "AC X " << a << endl;
  cout << "WA X " << w << endl;
  cout << "TLE X " << t << endl;
  cout << "RE X " << r << endl;
}
