#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  vector<string> cases = {"AC", "WA", "TLE", "RE"};
  vector<int> cnt(4);
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    for (int j = 0; j < 4; j++) {
      if (s == cases[j]) {
        cnt[j]++;
        break;
      }
    }
  }
  for (int i = 0; i < 4; i++) {
    cout << cases[i] << " x " << cnt[i] << "\n";
  }
  return 0;
}
