#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  int count[4];
  cin >> N;
  string judge;
  for (int i = 0; i < N; i++) {
    string t;
    cin >> t;
    judge += t[0];
  }
  for (int i = 0; i < N; i++) {
    count[i] = 0;
  }
  for (int i = 0; i < N; i++) {
    if (judge[i] == 'A')
      count[0]++;
    else if (judge[i] == 'W')
      count[1]++;
    else if (judge[i] == 'T')
      count[2]++;
    else if (judge[i] == 'R')
      count[3]++;
  }
  cout << "AC x ";
  cout << count[0] << endl;
  cout << "WA x ";
  cout << count[1] << endl;
  cout << "TLE x ";
  cout << count[2] << endl;
  cout << "RE x ";
  cout << count[3] << endl;
  return 0;
}
