#include <bits/stdc++.h>
using namespace std;
const char nl = '\n';
void IO() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
}
int N, T;
int main() {
  IO();
  vector<string> vec;
  cin >> T;
  int countRE = 0, countTLE = 0, countWA = 0, countAC = 0;
  while (T--) {
    string str;
    cin >> str;
    if (str == "AC") countAC++;
    if (str == "WA") countWA++;
    if (str == "TLE") countTLE++;
    if (str == "RE") countRE++;
  }
  cout << "AC"
       << " * " << countAC << endl;
  cout << "WA"
       << " * " << countWA << endl;
  cout << "TLE"
       << " * " << countTLE << endl;
  cout << "RE"
       << " * " << countRE << endl;
  return 0;
}
