#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using pii = pair<int, int>;
using Graph = vector<vector<int>>;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vi c = vi(4, 0);
  for (int i = 0; i < (int)(n); ++i) {
    string s;
    cin >> s;
    if (s == "AC") {
      c[0]++;
    } else if (s == "WA") {
      c[1]++;
    } else if (s == "TLE") {
      c[2]++;
    } else {
      c[3]++;
    }
  }
  cout << "AC x " << c[0] << endl;
  cout << "WA x " << c[1] << endl;
  cout << "TLE x " << c[2] << endl;
  cout << "WA x " << c[3] << endl;
}
