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