#include <bits/stdc++.h>
using namespace std;

int main() {
  
  int N;
  cin >> N;  
  string str;
  for (int i = 0; i < N; i++) {
  cin >> str.at(i);
  }
  
  int A = 0;
  int W = 0;
  int T = 0;
  int R = 0;
  string a =AC;
  string b =WA;
  string c =TLE;
  string d =RE;
  
  for (int i = 0; i < N; i++) {
  if (str.at(i)== a){
  A += 1
  }
  if (str.at(i)== b){
  W += 1
  }
  if (str.at(i)== c){
  T += 1
  }
  if (str.at(i)== d){
  R += 1
  }
  }  
  
  cout << "AC x " + A << endl;
  cout << "WA x " + W << endl;
  cout << "TLE x " + T << endl;
  cout << "RE x " + R << endl;
  
}
