#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const ll ATCODER_AMARI = 1000000007;
const ll INF = 10000000000000;
ll factorial(ll k) {
  ll sum = 1;
  for (int i = 1; i < k + 1; i++) {
    sum *= i;
  }
  return sum;
}
int main() {
  int n;
  cin >> n;
  map<string, int> count;
  for (int i = 0; i < (int)(n); i++) {
    string s;
    cin >> s;
    count[s]++;
  }
  cout << "AC x " << count["AC"] << endl;
  cout << "AC x " << count["WA"] << endl;
  cout << "AC x " << count["TLE"] << endl;
  cout << "AC x " << count["RE"] << endl;
}
