#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string str;
  unordered_map<string, int> result{
      {"AC", 0},
      {"WA", 0},
      {"TLE", 0},
      {"LE", 0},
  };
  for (int i = 0; i < n; i++) {
    cin >> str;
    result.at(str)++;
  }
  cout << "AC x " << result.at("AC") << endl;
  cout << "WA x " << result.at("WA") << endl;
  cout << "TLE x " << result.at("TLE") << endl;
  cout << "LE x " << result.at("LE") << endl;
}
