#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int i;
  string s;
  int cac = 0, ctel = 0, cwa = 0, cre = 0;
  for (i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC")
      cac++;
    else if (s == "WA")
      cwa++;
    else if (s == "TEL")
      ctel++;
    else
      cre++;
  }
  cout << "AC x " << cac << endl;
  cout << "WA x " << cwa << endl;
  cout << "TEL x " << ctel << endl;
  cout << "RE x " << cre << endl;
  return 0;
}
