#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int test;
  cin >> test;
  map<string, int> mp = {{"AC", 0}, {"WA", 0}, {"TLE", 0}, {"RE", 0}};
  while (test--) {
    string s;
    cin >> s;
    mp[s] += 1;
  }
  for (auto i : mp) {
    cout << i.first << " x " << i.second << endl;
  }
}
