#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> mapper;
  int n, i, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    string s;
    cin >> s;
    mapper[s]++;
  }
  string a[] = {"AC", "WA", "TLE", "RE"};
  for (i = 0; i < 4; i++) {
    cout << a[i] << " " << mapper[a[i]] << endl;
  }
  return 0;
};
