#include <bits/stdc++.h>
using namespace std;
vector<long long int> prm;
bool prime[10000001];
int binarySearch(int arr[], int l, int r, int x) {
  while (l <= r) {
    int m = l + (r - l) / 2;
    if (arr[m] == x) return m;
    if (arr[m] < x)
      l = m + 1;
    else
      r = m - 1;
  }
  return -1;
}
void SieveOfEratosthenes(int n) {
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == false) {
      for (int i = p * p; i <= n; i += p) prime[i] = true;
    }
  }
  for (int p = 2; p <= n; p++)
    if (!prime[p]) prm.push_back(p);
}
long long int fact(int n) {
  int res = 1;
  for (int i = 2; i <= n; i++) res = res * i;
  return res;
}
long long binomialCoeff(long long n, long long k) {
  long long C[n + 1][k + 1];
  long long i, j;
  for (i = 0; i <= n; i++) {
    for (j = 0; j <= min(i, k); j++) {
      if (j == 0 || j == i)
        C[i][j] = 1;
      else
        C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % 1000000007;
      C[i][j] %= 1000000007;
    }
  }
  return C[n][k];
}
int countDigit(long long n) {
  int count = 0;
  while (n != 0) {
    n = n / 10;
    ++count;
  }
  return count;
}
long long int power(int a, int b) {
  long long k = 1;
  for (int i = 0; i < b; i++) {
    k *= a;
    k %= 1000000007;
  }
  return k;
}
long long int maxSubArraySum(long long int a[], long long int size) {
  long long int max_so_far = 0, max_ending_here = 0;
  for (int i = 0; i < size; i++) {
    max_ending_here = max_ending_here + a[i];
    if (max_ending_here < 0)
      max_ending_here = 0;
    else if (max_so_far < max_ending_here)
      max_so_far = max_ending_here;
  }
  return max_so_far;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, a = 0, b = 0, c = 0, d = 0;
  cin >> n;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC")
      a++;
    else if (s == "WA")
      b++;
    else if (s == "TLE")
      c++;
    else
      d++;
  }
  cout << "AC X " << a << "\n";
  cout << "WA X " << b << "\n";
  cout << "TLE X " << c << "\n";
  cout << "RE X " << d << "\n";
  return 0;
}
