#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
using P = pair<int, int>;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
long long MOD = 1000000007;
long long INF = 1 << 30;
long long dp[110][100100];
int main() {
  int n;
  cin >> n;
  int a = 0, w = 0, t = 0, r = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") a++;
    if (s == "WA") w++;
    if (s == "TLE") t++;
    if (s == "RE") r++;
  }
  cout << "AC" << ' ' << 'x' << a << endl;
  cout << "WA" << ' ' << 'x' << w << endl;
  cout << "TLE" << ' ' << 'x' << t << endl;
  cout << "RE" << ' ' << 'x' << r << endl;
}
