#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s[100000];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  int cnt[4] = {0};
  for (int i = 0; i < n; i++) {
    if (s[i] == "AC") {
      cnt[0]++;
    } else if (s[i] == "WA") {
      cnt[1]++;
    } else if (s[i] == "TLE") {
      cnt[2]++;
    } else {
      cnt[3]++;
    }
  }
  for (int i = 0; i < 4; i++) {
    cout << "AC x " << cnt[i] << endl;
  }
  return 0;
}
