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