#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  string s;
  map<string, int> mp;
  for (int i = 0; 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";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout << setprecision(10);
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
