#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  string arr[a];
  for (int i = 0; i < a; i++) cin >> arr[i];
  map<string, int> m;
  for (auto i : arr) m[i]++;
  auto f1 = m.find("Ac");
  cout << "AC  x " << f1->second << endl;
  auto f2 = m.find("WA");
  cout << "WA  x " << f2->second << endl;
  auto f3 = m.find("TLE");
  cout << "TLE  x " << f3->second << endl;
  auto f4 = m.find("RE");
  cout << "RE  x " << f4->second << endl;
}
