#include <bits/stdc++.h>
using namespace std;
void fastio() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  fastio();
  int x, y, c = 0, t = 0, w = 0, r = 0;
  cin >> x;
  string a;
  while (x--) {
    cin >> a;
    if (a == "AC")
      c++;
    else if (a == "WA")
      w++;
    else if (a == "TLE")
      t++;
    else
      r++;
  }
  cout << "AC X " << c << "\n";
  cout << "WA X " << w << "\n";
  cout << "TLE X " << t << "\n";
  cout << "RE X " << r << "\n";
  return 0;
}
