#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
int main() {
  int n;
  cin >> n;
  int a, b, c, d;
  for (int i = 0; i < (n); ++i) {
    string s;
    string AC, WA, TLE, RE;
    cin >> s;
    if (s == AC) {
      ++a;
    } else if (s == WA) {
      ++b;
    } else if (s == TLE) {
      ++c;
    } else if (s == RE) {
      ++d;
    }
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << b << endl;
  cout << "TLE x " << c << endl;
  cout << "RE x " << d << endl;
  return 0;
}
