#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  vector<int> cnt(4);
  int n;
  cin >> n;
  string str;
  auto check = [](string str) -> int {
    if (str == "AC")
      return 0;
    else if (str == "WA")
      return 1;
    else if (str == "TLE")
      return 2;
    else
      return 3;
  };
  auto rev = [](int n) -> string {
    return n == 0 ? "AC" : (n == 1 ? "WA" : (n == 2 ? "TLE" : "WA"));
  };
  for (int i = 1; i <= n; ++i) {
    cin >> str;
    cnt[check(str)]++;
  }
  for (int i = 0; i < 4; ++i) {
    cout << rev(i) << " x " << cnt[i] << '\n';
  }
}
