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