#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(30);
  ;
  int n;
  cin >> n;
  map<string, int> m;
  while (n--) {
    string s;
    cin >> s;
    m[s]++;
  }
  for (string s : {"AS", "WA", "TLE", "RE"}) cout << s << " x " << m[s] << '\n';
  return 0;
}
