#include <bits/stdc++.h>
using namespace std;
int long long gcd(int long long a, int long long b) {
  return b ? gcd(b, a % b) : a;
}
int long long lcm(int long long a, int long long b) {
  return a / gcd(a, b) * b;
}
int long long GetDigit(int long long num) {
  int long long digit = 0;
  while (num != 0) {
    num /= 10;
    digit++;
  }
  return digit;
}
int long long GetDigitN(int long long num, int long long N) {
  int long long digit = 0;
  while (num != 0) {
    num /= N;
    digit++;
  }
  return digit;
}
int long long divisorcount(int long long n) {
  int long long ans = 1;
  vector<int> x(n + 1);
  int long long num = n;
  for (int long long i = 2; i <= n; i++) {
    while (num % i == 0) {
      x.at(i)++;
      num /= i;
    }
  }
  for (int i = 2; i <= n; i++) {
    ans *= x.at(i) + 1;
  }
  return ans;
}
int main() {
  int N;
  cin >> N;
  int A = 0, B = 0, C = 0, D = 0;
  string S;
  for (int i = 0; i < N; i++) {
    cin >> S;
    if (S == "AC") {
      A = A + 1;
    } else if (S == "WA") {
      B = B + 1;
    } else if (S == "TLE") {
      C = C + 1;
    } else {
      D = D + 1;
    }
  }
  cout << "AC"
       << " " << 'x' << A << endl;
  cout << "WA"
       << " " << 'x' << B << endl;
  cout << "TLE"
       << " " << 'x' << C << endl;
  cout << "RE"
       << " " << 'x' << D << endl;
  return 0;
}
