#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int c0 = 0, c1 = 0, c2 = 0, c3 = 0;
  char s[4];
  for (int i = 1; i <= N; i++) {
    gets(s);
    if (s == "AC")
      c0++;
    else if (s == "WA")
      c1++;
    else if (s == "TLE")
      c2++;
    else
      c3++;
  }
  cout << "AC"
       << " x " << c0;
  cout << "AC"
       << " x " << c1;
  cout << "AC"
       << " x " << c2;
  cout << "AC"
       << " x " << c3;
}
