#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  int n;
  cin >> n;
  map<string, int> m;
  while (n--) {
    string s;
    cin >> s;
    m[s]++;
  }
  cout << "AC x " << m["AC"] << '\n'
       << "WA x " << m["WA"] << '\n'
       << "TLE x " << m["TLE"] << '\n'
       << "RE x " << m["RE"] << '\n';
  return 0;
}
