#include <bits/stdc++.h>
using namespace std;
signed main() {
  int N, AC = 0, WA = 0, TLE = 0, RE = 0;
  cin >> N;
  string tmp;
  for (long long i = 0; i < (long long)(N); i++) {
    cin >> tmp;
    if (tmp == "AC") {
      AC += 1;
    }
    if (tmp == "WA") {
      WA += 1;
    }
    if (tmp == "TLE") {
      TLE += 1;
    }
    if (tmp == "RE") {
      AC += 1;
    }
  }
  cout << "AC x " << AC << endl;
  cout << "WA x " << WA << endl;
  cout << "TLE x " << TLE << endl;
  cout << "RE x " << RE << endl;
  return 0;
}
