#include <bits/stdc++.h>
using namespace std;
priority_queue<long long, vector<long long>, greater<long long>> pq1, pq2;
long long power(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    res *= a;
    b--;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, i;
  string str;
  cin >> n;
  long long cnt1 = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0;
  for (i = 0; i < n; i++) {
    cin >> str;
    if (str[0] == 'A')
      cnt1++;
    else if (str[0] == 'W')
      cnt2++;
    else if (str[0] == 'T')
      cnt3++;
    else if (str[0] == 'R')
      cnt4++;
  }
  cout << "AC X " << cnt1 << endl;
  cout << "WA X " << cnt2 << endl;
  cout << "TLE X " << cnt3 << endl;
  cout << "RE X " << cnt4 << endl;
  return 0;
}
