#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using graph = vector<vector<int>>;
const ll mod = pow(10, 9) + 7;
const int INF = 1e9;
const ll LINF = 1e18;
const double pi = 3.14159265358979323846;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  int N;
  cin >> N;
  string s;
  map<string, int> cnt;
  for (int i = 0; i < (int)N; i++) {
    cin >> s;
    cnt[s]++;
  }
  cout << "AC x" << cnt["AC"] << endl;
  cout << "WA x" << cnt["WA"] << endl;
  cout << "TLE x" << cnt["TLE"] << endl;
  cout << "RE x" << cnt["RE"] << endl;
}
