#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int c0 = 0, c1 = 0, c2 = 0, c3 = 0;
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    if (s == "AC") {
      c0++;
    } else if (s == "WA") {
      c1++;
    } else if (s == "TLE") {
      c2++;
    } else if (s == "RE") {
      c3++;
    }
  }
  cout << "AC x " << c0 << "\n";
  cout << "WA x " << c1 << "\n";
  cout << "TEL x " << c2 << "\n";
  cout << "RE x " << c3 << "\n";
  return 0;
}
