#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
string str;
int n, AC = 0, WA = 0, TLE = 0, RE = 0;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> str;
    if (str == "AC") {
      ++AC;
    } else if (str == "WA") {
      ++WA;
    } else if (str == "TLE") {
      ++TLE;
    } else if (str == "RE") {
      ++RE;
    }
  }
  cout << "AC"
       << " * " << AC << endl;
  cout << "WA"
       << " * " << WA << endl;
  cout << "TLE"
       << " * " << TLE << endl;
  cout << "RE"
       << " * " << RE << endl;
  return 0;
}
