#include <bits/stdc++.h>
using namespace std;
bool compare(const pair<int, double>& p1, const pair<int, double>& p2) {
  if (p1.second > p2.second)
    return true;
  else if (p1.second == p2.second)
    return p1.first < p2.first;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout.precision(2);
  long long n;
  cin >> n;
  string s;
  unordered_map<string, int> m;
  for (int i = 0; i < n; i++) {
    cin >> s;
    m[s]++;
  }
  cout << "AC"
       << " "
       << "*"
       << " " << m["AC"] << "\n";
  cout << "WA"
       << " "
       << "*"
       << " " << m["WA"] << "\n";
  cout << "TLE"
       << " "
       << "*"
       << " " << m["TLE"] << "\n";
  cout << "RE"
       << " "
       << "*"
       << " " << m["RE"] << "\n";
  return 0;
}
