#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  int n;
  int x = 0;
  int y = 0;
  int z = 0;
  int b = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    if (a == "AC") {
      x++;
    } else if (a == "WA") {
      y++;
    } else if (a == "RTE") {
      b++;
    } else if (a == "TLE") {
      z++;
    }
  }
  cout << "AC"
       << " "
       << "x"
       << " " << x << endl;
  cout << "WA"
       << " "
       << "x"
       << " " << y << endl;
  cout << "TLE"
       << " "
       << "x"
       << " " << z << endl;
  cout << "RTE"
       << " "
       << "x"
       << " " << b << endl;
}
