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