#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  map<string, int> m;
  m["AC"] == 0;
  m["WA"] == 0;
  m["TLE"] == 0;
  while (n--) {
    string s;
    cin >> s;
    m[s]++;
  }
  for (map<string, int>::iterator it = m.begin(); it != m.end(); ++it) {
    cout << it->first << " "
         << "x"
         << " " << it->second << endl;
  }
  return 0;
}
