#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e4;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  cin >> n;
  int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC") c1++;
    if (s == "WA") c2++;
    if (s == "TLE") c3++;
    if (s == "RE") c4++;
  }
  char ss = 'X';
  cout << "AC"
       << " " << ss << " " << c1 << '\n';
  cout << "WA"
       << " " << ss << " " << c2 << '\n';
  cout << "TLE"
       << " " << ss << " " << c3 << '\n';
  cout << "RE"
       << " " << ss << " " << c4 << '\n';
  return 0;
}
