#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7, N = 5e5 + 10;
const long long LINF = LLONG_MAX;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  map<string, long long> maps;
  maps["AC"] = 0;
  maps["WA"] = 0;
  maps["TLE"] = 0;
  maps["RE"] = 0;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    maps[s]++;
  }
  cout << "AC X " << maps["AC"] << "\n";
  cout << "WA X " << maps["Wa"] << "\n";
  cout << "TLE X " << maps["TLE"] << "\n";
  cout << "RE X " << maps["RE"] << "\n";
  return 0;
}
