#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimization("Ofast")
#pragma GCC optimization("unroll-loops")
void solve() {
  int n;
  cin >> n;
  unordered_map<string, int> fr;
  fr.insert(pair<string, int>("RE", 0));
  fr.insert(pair<string, int>("TLE", 0));
  fr.insert(pair<string, int>("WA", 0));
  fr.insert(pair<string, int>("AC", 0));
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    fr[s]++;
  }
  for (auto it = fr.begin(); it != fr.end(); it++)
    cout << it->first << " x " << it->second << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
