#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int N;
  cin >> N;
  unordered_map<string, int> A;
  for (int i = 0; i < N; i++) {
    string temp;
    cin >> temp;
    A[temp]++;
  }
  string arr[4] = {"AC", "WA", "TLE", "RE"};
  for (int i = 0; i < 4; i++) {
    cout << arr[i] << " x " << A[arr[i]] << "\n";
  }
}
