#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000000000001;
const long long MOD = 1000000007;
void solve() {
  long long n;
  cin >> n;
  string s;
  unordered_map<string, long long> make_pair;
  while (n--) {
    cin >> s;
    make_pair[s]++;
  }
  cout << "AC X " << make_pair["AC"] << "\n";
  cout << "WA X " << make_pair["WA"] << "\n";
  cout << "TLE X " << make_pair["TLE"] << "\n";
  cout << "RE X " << make_pair["RE"] << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
