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