#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans[4];
  int N;
  cin >> N;
  string arr[N + 1];
  for (int i = 1; i <= N; i++) cin >> arr[i];
  ans[0] = ans[1] = ans[2] = ans[3] = 0;
  for (int i = 1; i <= N; i++) {
    if (arr[i] == "AC") {
      ans[0] += 1;
    } else if (arr[i] == "WA") {
      ans[1] += 1;
    } else if (arr[i] == "TLE") {
      ans[2] += 1;
    } else {
      ans[3] += 1;
    }
  }
  cout << "AC x";
  cout << ans[0] << endl;
  cout << "WA x";
  cout << ans[1] << endl;
  cout << "TLE x";
  cout << ans[2] << endl;
  cout << "RE x";
  cout << ans[3] << endl;
}
