#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  map<string, int> S;
  S["AC"] = 0;
  S["WA"] = 0;
  S["TLE"] = 0;
  S["RE"] = 0;
  for (int i = 0; i < n; i++) {
    cin >> s;
    S[s]++;
  }
  cout << "AC"
       << " "
       << "x" << S.at("AC") << endl;
  cout << "WA"
       << " "
       << "x" << S.at("WA") << endl;
  cout << "TLE"
       << " "
       << "x" << S.at("TLE") << endl;
  cout << "RE"
       << " "
       << "x" << S.at("RE") << endl;
}
