#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  map<string, long long> mp;
  string s;
  long long i;
  for (i = 1; i <= n; i++) {
    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';
}
