#include <bits/stdc++.h>
using namespace std;
int main() {
  string ac = "AC";
  string WA = "WA";
  string TLE = "TLE";
  string RE = "RE";
  int n, a = 0, w = 0, t = 0, r = 0;
  string *ar = new string[n];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> ar[i];
  for (int i = 0; i < n; i++) {
    if (ar[i] == "AC") {
      a++;
    } else if (ar[i] == "WA") {
      w++;
    } else if (ar[i] == "TLE") {
      t++;
    } else if (ar[i] == "RE") {
      r++;
    }
  }
  cout << ac << " "
       << "x"
       << " " << a << endl;
  cout << WA << " "
       << "x"
       << " " << w << endl;
  cout << TLE << " "
       << "x"
       << " " << t << endl;
  cout << RE << " "
       << "x"
       << " " << r << endl;
  return 0;
}
