#include <bits/stdc++.h>
using namespace std;
int main() {
  unordered_map<string, int> mp;
  mp["AC"] = 0;
  mp["WA"] = 0;
  mp["TLE"] = 0;
  mp["RE"] = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    mp[s]++;
  }
  for (auto it : mp) {
    cout << it.first << " x " << it.second << endl;
  }
}
