#include <bits/stdc++.h>
using namespace std;
long long quick_pow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res = a * res;
    }
    a = a * a;
    b >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) {
  a = abs(a), b = abs(b);
  while (b != 0) {
    a %= b;
    swap(a, b);
  }
  return a;
}
bool cmp(const pair<string, int> &p1, const pair<string, int> &p2) {
  return p2.second < p1.second;
}
void solve() {
  int t;
  cin >> t;
  string s;
  int hash[4] = {0};
  while (t--) {
    cin >> s;
    if (s == "AC") {
      hash[0]++;
    }
    if (s == "WA") {
      hash[1]++;
    }
    if (s == "TLE") {
      hash[2]++;
    }
    if (s == "RE") {
      hash[3]++;
    }
  }
  cout << "AC X " << hash[0] << endl;
  cout << "WA X " << hash[1] << endl;
  cout << "TLE X " << hash[2] << endl;
  cout << "RE X " << hash[3] << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  solve();
  return 0;
}
