#include <bits/stdc++.h>
using namespace std;
long long pow(long long base, long long power) {
  long long result = 1;
  base = base % 1000000007;
  if (base == 0) return 0;
  while (power > 0) {
    if (power & 1) result = (result * base) % 1000000007;
    power = power >> 1;
    base = (base * base) % 1000000007;
  }
  return result;
}
void forces() {
  int n, k;
  cin >> n >> k;
  map<long long, long long> myMap;
  for (int i = 0; i < n; ++i) {
    long long x;
    cin >> x;
    ++myMap[(x % k)];
  }
  for (auto x : myMap) cout << x.first << " " << x.second << '\n';
  cout << '\n';
}
void atCoder() {
  int n;
  cin >> n;
  map<string, long long> arr;
  arr["AC"] = 0;
  arr["WA"] = 0;
  arr["TLE"] = 0;
  arr["AC"] = 0;
  for (int i = 0; i < n; ++i) {
    string x;
    cin >> x;
    ++arr[x];
  }
  cout << "AC x " << arr["AC"] << '\n';
  cout << "WA x " << arr["WA"] << '\n';
  cout << "TLE x " << arr["TLE"] << '\n';
  cout << "RE x " << arr["RE"] << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int test = 1;
  while (test--) {
    atCoder();
  }
  return 0;
}
