#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n;
  cin >> n;
  int a = 0;
  int b = 0;
  int c = 0;
  int d = 0;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC") a++;
    if (s == "WA") b++;
    if (s == "TLE") c++;
    if (s == "RE") d++;
  }
  cout << "AC" << ' ' << 'x' << a << endl;
  cout << "WA" << ' ' << 'x' << b << endl;
  cout << "TLE" << ' ' << 'x' << c << endl;
  cout << "RE" << ' ' << 'x' << d << endl;
}
