#include <bits/stdc++.h>
using namespace std;
const int MAX_N = int(1e6) + 10;
const long long int MOD = 1e9 + 7;
const long long int INF = 1e18;
inline long long int mul(long long int a, long long int b) {
  a = (a + MOD) % MOD;
  b = (b + MOD) % MOD;
  long long int c = a * b;
  c = (c + MOD) % MOD;
  return c;
}
inline long long int add(long long int a, long long int b) {
  a = (a + MOD) % MOD;
  b = (b + MOD) % MOD;
  long long int ans = (a + b);
  ans = (ans + MOD) % MOD;
  return ans;
}
long long int power(long long int a, long long int b, long long int c = 0) {
  long long int ans = 1;
  while (b) {
    if (b & 1) {
      ans = mul(ans, a);
    }
    a = mul(a, a);
    b = b / 2;
  }
  return ans;
}
long long int a[200005];
int main() {
  int n;
  cin >> n;
  map<string, int> mp;
  for (int i = 1; i <= n; i++) {
    string s;
    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";
}
