#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, tmp;
  vector <int> v;
  cin >> n;
  for (int i = 0; i < n; i++){
    cin >> tmp;
    v.push_back(tmp);
  }
  
  cout << "AC x " << count(v.begin(), v.end(), "AC") << '\n';
  cout << "WA x " << count(v.begin(), v.end(), "WA") << '\n';
  cout << "TLE x " << count(v.begin(), v.end(), "TLE") << '\n';
  cout << "RE x " << count(v.begin(), v.end(), "RE") << '\n'; 
}