#include <bits/stdc++.h>
using namespace std;
long long sum1(long long x) {
  long long sum = 0;
  while (x != 0) {
    long long r = x % 10;
    x = x / 10;
    sum = sum + r;
  }
  return (sum);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  map<string, long long> m1;
  while (n--) {
    string s;
    cin >> s;
    m1[s]++;
  }
  cout << "AC X " << m1["AC"] << endl;
  cout << "WA X " << m1["WA"] << endl;
  cout << "TLE X " << m1["TLE"] << endl;
  cout << "RE X " << m1["RE"] << endl;
}
