#include <bits/stdc++.h>
using namespace std;
void outi(int x) { cout << x << endl; }
void outl(long long x) { cout << x << endl; }
void outs(string x) { cout << x << endl; }
long long max(long long a, long long b) {
  long long max;
  if (a > b)
    max = a;
  else
    max = b;
  return max;
}
long long min(long long a, long long b) {
  long long min;
  if (a < b)
    min = a;
  else
    min = b;
  return min;
}
int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
int main() {
  int n;
  cin >> n;
  string s;
  for (int i = 0; i < (n); ++i) {
    cin >> s[i];
  }
  int countAC = 0;
  int countWA = 0;
  int countTLE = 0;
  int countRE = 0;
  for (int i = 0; i < (n); ++i) {
    if (s[i] == 'AC') {
      countAC++;
    }
    if (s[i] == 'WA') {
      countWA++;
    }
    if (s[i] == 'TLE') {
      countTLE++;
    }
    if (s[i] == 'RE') {
      countRE++;
    }
  }
  cout << "AC x " << countAC << endl;
  cout << "WA x " << countWA << endl;
  cout << "TLE x " << countTLE << endl;
  cout << "RE x " << countRE << endl;
}
