#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  int count1 = 0;
  int count2 = 0;
  int count3 = 0;
  int count4 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'AC') count1++;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == 'WA') count2++;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == 'TLE') count3++;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == 'RE') count4++;
  }
  cout << "AC x " << count1 << endl;
  cout << "WA x " << count2 << endl;
  cout << "TLE x " << count3 << endl;
  cout << "RE x " << count4 << endl;
  return 0;
}
