#include <bits/stdc++.h>
using namespace std;
void inn(int &number);
void code() {
  int n;
  cin >> n;
  map<string, int> make_pair;
  make_pair["AC"] = 0;
  make_pair["TLE"] = 0;
  make_pair["WA"] = 0;
  make_pair["RE"] = 0;
  while (n--) {
    string s;
    cin >> s;
    make_pair[s]++;
  }
  map<string, int>::iterator it;
  for (it = make_pair.begin(); it != make_pair.end(); it++) {
    cout << it->first << " x " << it->second << endl;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  for (int i = 0; i < t; i++) {
    code();
  }
  return 0;
}
