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